*importing school district start dates
import delimited "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Burbio_districtstarts.csv"

gen stata_startdate = date(startdate,"MDY")

collapse (min) stata_startdate_min = stata_startdate, by(countyfips)

save "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Start Date County - 210303.dta"


clear

*importing data
import delimited "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\weekly_data_transformed_feb_22.csv"

generate countyfips = fips

merge m:1 countyfips using "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Start Date County - 210303.dta"



**importing the age-specific case datasets
*0-9 years
merge m:1 fips date using "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Cases - 0-9 Years - 210411.dta", generate(_merge_0_9_years)

*10-19 years
merge m:1 fips date using "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Cases - 10-19 Years - 210411.dta", generate(_merge_10_19_years)

*20+ years
merge m:1 fips date using "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Cases - 20+ Years - 210411.dta", generate(_merge_20_years)


*importing income and rurality data
merge m:1 fips using "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Unemployment & Income - 210419.dta", generate(_merge_income)

*https://seer.cancer.gov/seerstat/variables/countyattribs/ruralurban.html
generate metro = 1 if inlist(rural_urban_continuum_code_2013, 1, 2, 3)
replace metro = 0 if inlist(rural_urban_continuum_code_2013, 4, 5, 6, 7, 8, 9)

*importing NCHS rurality data
merge m:1 fips using "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\NCHSURCodes - 210419.dta", generate(_merge_rurality)

*https://www.cdc.gov/nchs/data_access/urban_rural.htm
*https://www.cdc.gov/nchs/data/series/sr_02/sr02_154.pdf
generate nchsurc_urban = 1 if inlist(nchsurc_2013_cat, 1, 2)
replace nchsurc_urban = 0 if inlist(nchsurc_2013_cat, 3, 4, 5, 6)




gen stata_date = date(date,"MDY")

gen week_from_opening = stata_date - stata_startdate_min

gen week_from_opening_7 = round(week_from_opening/7)


*shifting these values forward by 5 so that -4 becomes the new 1 as per Emily's suggestion 
generate week_from_opening_7_5 = week_from_opening_7+5

generate week_from_opening_7_5_2 = week_from_opening_7_5 if week_from_opening_7_5 >= 0 & week_from_opening_7_5 <= 18


*turning week variable into numeric
encode date, generate(date_num)

*creating the opening school mode
k5_v gr68_v gr912_v 
k5_h gr68_h gr912_h
k5_t gr68_t gr912_t

egen open1_k5_v = min(k5_v) if week_from_opening_7 == 1, by(fips)
egen open1_gr68_v = min(gr68_v) if week_from_opening_7 == 1, by(fips)
egen open1_gr912_v = min(gr912_v) if week_from_opening_7 == 1, by(fips)

egen open1_k5_h = min(k5_h) if week_from_opening_7 == 1, by(fips)
egen open1_gr68_h = min(gr68_h) if week_from_opening_7 == 1, by(fips)
egen open1_gr912_h = min(gr912_h) if week_from_opening_7 == 1, by(fips)

egen open1_k5_t = min(k5_t) if week_from_opening_7 == 1, by(fips)
egen open1_gr68_t = min(gr68_t) if week_from_opening_7 == 1, by(fips)
egen open1_gr912_t = min(gr912_t) if week_from_opening_7 == 1, by(fips)

generate open1_k5_sum = open1_k5_v + open1_k5_h + open1_k5_t
generate open1_gr68_sum = open1_gr68_v + open1_gr68_h + open1_gr68_t
generate open1_gr912_sum = open1_gr912_v + open1_gr912_h + open1_gr912_t


br fips open1_k5_v open1_gr68_v open1_gr912_v open1_k5_h open1_gr68_h open1_gr912_h open1_k5_t open1_gr68_t open1_gr912_t if week_from_opening_7 == 1

*taking the means across grades for each mode
gen open1_v_mean = (open1_k5_v + open1_gr68_v + open1_gr912_v)/3
gen open1_h_mean = (open1_k5_h + open1_gr68_h + open1_gr912_h)/3
gen open1_t_mean = (open1_k5_t + open1_gr68_t + open1_gr912_t)/3

br fips open1_k5_v open1_gr68_v open1_gr912_v open1_k5_h open1_gr68_h open1_gr912_h open1_k5_t open1_gr68_t open1_gr912_t open1_v_mean open1_h_mean open1_t_mean if week_from_opening_7 == 1

***THERE ARE SEVERAL OPTIONS FOR COMBINING THESE SCHOOL MODE MEASURES ACROSS GRADES FOR A CERTAIN COUNTY
**OPTION #1 (missing if 2 modes have the same value)
*taking the max value of the 3 means for each mode
generate open1_mean_cat = 0 if open1_v_mean > open1_h_mean & open1_v_mean > open1_t_mean & week_from_opening_7 == 1
replace open1_mean_cat = 1 if open1_h_mean > open1_v_mean & open1_h_mean > open1_t_mean & week_from_opening_7 == 1
replace open1_mean_cat = 2 if open1_t_mean > open1_v_mean & open1_t_mean > open1_h_mean & week_from_opening_7 == 1

*apply this new variable to all rows
egen open1_mean_cat_all = min(open1_mean_cat), by(fips)

**OPTION #2 (missing if none of the 3 modes = 1)
*taking the max value of the 3 means for each mode
generate open1_mean_cat2 = 0 if open1_v_mean == 1 & week_from_opening_7 == 1
replace open1_mean_cat2 = 1 if open1_h_mean == 1 & week_from_opening_7 == 1
replace open1_mean_cat2 = 2 if open1_t_mean == 1 & week_from_opening_7 == 1

*apply this new variable to all rows
egen open1_mean_cat2_all = min(open1_mean_cat2), by(fips)



**CREATING HYBRID BETWEEN THESE 2 APPROACHES
**just 1 row
*category 0 = all virtual
generate open1_mean_cat3 = 0 if open1_mean_cat2 == 0
*category 1 = majority virtual but not all
replace open1_mean_cat3 = 1 if open1_mean_cat == 0 & open1_mean_cat2 != 0
*category 2 = majority hybrid but not all
replace open1_mean_cat3 = 2 if open1_mean_cat == 1 & open1_mean_cat2 != 1
*category 3 = all hybrid
replace open1_mean_cat3 = 3 if open1_mean_cat2 == 1 
*category 4 = majority traditional but not all
replace open1_mean_cat3 = 4 if open1_mean_cat == 2 & open1_mean_cat2 != 2
*category 5 = all traditional
replace open1_mean_cat3 = 5 if open1_mean_cat2 == 2 

**applied to all rows
*category 0 = all virtual
generate open1_mean_cat3_all = 0 if open1_mean_cat2_all == 0
*category 1 = majority virtual but not all
replace open1_mean_cat3_all = 1 if open1_mean_cat_all == 0 & open1_mean_cat2_all != 0
*category 2 = majority hybrid but not all
replace open1_mean_cat3_all = 2 if open1_mean_cat_all == 1 & open1_mean_cat2_all != 1
*category 3 = all hybrid
replace open1_mean_cat3_all = 3 if open1_mean_cat2_all == 1 
*category 4 = majority traditional but not all
replace open1_mean_cat3_all = 4 if open1_mean_cat_all == 2 & open1_mean_cat2_all != 2
*category 5 = all traditional
replace open1_mean_cat3_all = 5 if open1_mean_cat2_all == 2 


*in Zeynep's original data, the cases variable was constructed as cases per 1,000 so I need to convert this to cases per 100,000
generate cases_per_pop_100K = cases_per_pop*100
generate cases_per_pop_0_9_100K = all_cases_per_pop_0_9*100
generate cases_per_pop_10_19_100K = all_cases_per_pop_10_19*100
generate cases_per_pop_20_100K = all_cases_per_pop_20*100

generate deaths_per_pop_100K = deaths_per_pop*100


*CREATING categorical variables for all of the Oxford policy variables
generate c2_workplaceclosing_cat = 0
replace c2_workplaceclosing_cat = 1 if c2_workplaceclosing_10 > 0
replace c2_workplaceclosing_cat = 2 if c2_workplaceclosing_20 > 0
replace c2_workplaceclosing_cat = 3 if c2_workplaceclosing_30 > 0

generate c3_cancelpublicevents_cat = 0
replace c3_cancelpublicevents_cat = 1 if c3_cancelpublicevents_10 > 0
replace c3_cancelpublicevents_cat = 2 if c3_cancelpublicevents_20 > 0

generate c4_restrictionsongatherings_cat = 0
replace c4_restrictionsongatherings_cat = 1 if c4_restrictionsongatherings_10 > 0
replace c4_restrictionsongatherings_cat = 2 if c4_restrictionsongatherings_20 > 0
replace c4_restrictionsongatherings_cat = 3 if c4_restrictionsongatherings_30 > 0
replace c4_restrictionsongatherings_cat = 4 if c4_restrictionsongatherings_40 > 0

generate c5_closepublictransport_cat = 0
replace c5_closepublictransport_cat = 1 if c5_closepublictransport_10 > 0
replace c5_closepublictransport_cat = 2 if c5_closepublictransport_20 > 0

generate c5_closepublictransport_cat = 0
replace c5_closepublictransport_cat = 1 if c5_closepublictransport_10 > 0
replace c5_closepublictransport_cat = 2 if c5_closepublictransport_20 > 0

generate c7_flag = 0
replace c7_flag = 1 if c7_flag_10 > 0

generate c8_internattravelcontrols_cat = 0
replace c8_internattravelcontrols_cat = 1 if c8_internationaltravelcontrols_1 > 0
replace c8_internattravelcontrols_cat = 2 if c8_internationaltravelcontrols_2 > 0
replace c8_internattravelcontrols_cat = 3 if c8_internationaltravelcontrols_3 > 0
replace c8_internattravelcontrols_cat = 4 if c8_internationaltravelcontrols_4 > 0

generate h2_testingpolicy_cat = 0
replace h2_testingpolicy_cat = 1 if h2_testingpolicy_10 > 0
replace h2_testingpolicy_cat = 2 if h2_testingpolicy_20 > 0
replace h2_testingpolicy_cat = 3 if h2_testingpolicy_30 > 0
      
generate h3_contacttracing_cat = 0
replace h3_contacttracing_cat = 1 if h3_contacttracing_10 > 0
replace h3_contacttracing_cat = 2 if h3_contacttracing_20 > 0

generate h6_facialcoverings_cat = 0
replace h6_facialcoverings_cat = 1 if h6_facialcoverings_10 > 0
replace h6_facialcoverings_cat = 2 if h6_facialcoverings_20 > 0
replace h6_facialcoverings_cat = 3 if h6_facialcoverings_30 > 0
replace h6_facialcoverings_cat = 4 if h6_facialcoverings_40 > 0

	               
*CREATING THE MASK MANDATE AT OPENING VARIABLE
generate h6_facialcoverings_open_cat = 0 if week_from_opening_7_5_2 == 0
replace h6_facialcoverings_open_cat = 1 if h6_facialcoverings_10 == 1 & week_from_opening_7_5_2 == 0
replace h6_facialcoverings_open_cat = 2 if h6_facialcoverings_20 == 1 & week_from_opening_7_5_2 == 0
replace h6_facialcoverings_open_cat = 3 if h6_facialcoverings_30 == 1 & week_from_opening_7_5_2 == 0
replace h6_facialcoverings_open_cat = 4 if h6_facialcoverings_40 == 1 & week_from_opening_7_5_2 == 0






br fips open1_k5_v open1_gr68_v open1_gr912_v open1_k5_h open1_gr68_h open1_gr912_h open1_k5_t open1_gr68_t open1_gr912_t open1_v_mean open1_h_mean open1_t_mean open1_mean_cat open1_mean_cat_all open1_mean_cat2 open1_mean_cat2_all if week_from_opening_7 == 1

***creating the change from baseline dependent variable
**cases
*overall
generate cases_per_pop_bl = cases_per_pop if week_from_opening_7_5_2 == 0
egen cases_per_pop_bl_all = min(cases_per_pop_bl), by(fips)
generate cases_per_pop_bl_diff = cases_per_pop - cases_per_pop_bl_all
generate cases_per_pop_bl_diff_log = log(cases_per_pop_bl_diff)

*age 0-9
generate cases_per_pop_bl_0_9 = all_cases_per_pop_0_9 if week_from_opening_7_5_2 == 0
egen cases_per_pop_bl_0_9_all = min(cases_per_pop_bl_0_9), by(fips)
generate cases_per_pop_bl_0_9_diff = all_cases_per_pop_0_9 - cases_per_pop_bl_0_9_all
generate cases_per_pop_bl_0_9_diff_log = log(cases_per_pop_bl_0_9_diff)

*age 10-19
generate cases_per_pop_bl_10_19 = all_cases_per_pop_10_19 if week_from_opening_7_5_2 == 0
egen cases_per_pop_bl_10_19_all = min(cases_per_pop_bl_10_19), by(fips)
generate cases_per_pop_bl_10_19_diff = all_cases_per_pop_10_19 - cases_per_pop_bl_0_9_all
generate cases_per_pop_bl_10_19_diff_log = log(cases_per_pop_bl_10_19_diff)

*age 20+
generate cases_per_pop_bl_20 = all_cases_per_pop_20 if week_from_opening_7_5_2 == 0
egen cases_per_pop_bl_20_all = min(cases_per_pop_bl_20), by(fips)
generate cases_per_pop_bl_20_diff = all_cases_per_pop_20 - cases_per_pop_bl_20_all
generate cases_per_pop_bl_20_diff_log = log(cases_per_pop_bl_20_diff)


*deaths
generate deaths_per_pop_bl = deaths_per_pop if week_from_opening_7_5_2 == 0
egen deaths_per_pop_bl_all = min(deaths_per_pop_bl), by(fips)
generate deaths_per_pop_bl_diff = deaths_per_pop - deaths_per_pop_bl_all
generate deaths_per_pop_bl_diff_log = log(deaths_per_pop_bl_diff)



**creating the mask mandate variables 
*for opening week

generate h6_facialcoverings4 = 0 if week_from_opening_7_5_2 == 0
replace h6_facialcoverings4 = 1 if h6_facialcoverings_open_cat >=4 & week_from_opening_7_5_2 == 0

generate h6_facialcoverings34 = 0 if week_from_opening_7_5_2 == 0
replace h6_facialcoverings34 = 1 if h6_facialcoverings_open_cat >=3 & week_from_opening_7_5_2 == 0

generate h6_facialcoverings234 = 0 if week_from_opening_7_5_2 == 0
replace h6_facialcoverings234 = 1 if h6_facialcoverings_open_cat >=2 & week_from_opening_7_5_2 == 0

egen h6_facialcoverings4_all = min(h6_facialcoverings4), by(fips)
egen h6_facialcoverings34_all = min(h6_facialcoverings34), by(fips)
egen h6_facialcoverings234_all = min(h6_facialcoverings234), by(fips)


*for current week

generate h6_facialcoverings4_current = 0
replace h6_facialcoverings4_current = 1 if h6_facialcoverings_cat >=4 

generate h6_facialcoverings34_current = 0
replace h6_facialcoverings34_current = 1 if h6_facialcoverings_cat >=3

generate h6_facialcoverings234_current = 0
replace h6_facialcoverings234_current = 1 if h6_facialcoverings_cat >=2

egen h6_facialcoverings4_current_all = min(h6_facialcoverings4), by(fips)
egen h6_facialcoverings34_current_all = min(h6_facialcoverings34), by(fips)
egen h6_facialcoverings234_curr_all = min(h6_facialcoverings234), by(fips)



mean deaths_per_pop, over(week_from_opening_7_5_2)
mean cases_per_pop, over(week_from_opening_7_5_2)

mean cases_per_pop if open1_mean_cat_all == 0, over(week_from_opening_7_5_2)
mean cases_per_pop if open1_mean_cat_all == 1, over(week_from_opening_7_5_2)
mean cases_per_pop if open1_mean_cat_all == 2, over(week_from_opening_7_5_2)

mean deaths_per_pop if open1_mean_cat_all == 0, over(week_from_opening_7_5_2)
mean deaths_per_pop if open1_mean_cat_all == 1, over(week_from_opening_7_5_2)
mean deaths_per_pop if open1_mean_cat_all == 2, over(week_from_opening_7_5_2)




*examining things by state
generate state_fips = floor(fips/1000)

generate state = "AL" if state_fips == 1
replace state = "AZ" if state_fips == 4
replace state = "AR" if state_fips == 5
replace state = "CA" if state_fips == 6
replace state = "CO" if state_fips == 8
replace state = "CT" if state_fips == 9
replace state = "DE" if state_fips == 10
replace state = "FL" if state_fips == 12
replace state = "GA" if state_fips == 13
replace state = "HI" if state_fips == 15
replace state = "ID" if state_fips == 16
replace state = "IL" if state_fips == 17
replace state = "IN" if state_fips == 18
replace state = "IA" if state_fips == 19
replace state = "KS" if state_fips == 20
replace state = "KY" if state_fips == 21
replace state = "ME" if state_fips == 23
replace state = "MD" if state_fips == 24
replace state = "MA" if state_fips == 25
replace state = "MI" if state_fips == 26
replace state = "MN" if state_fips == 27
replace state = "MS" if state_fips == 28
replace state = "MO" if state_fips == 29
replace state = "MT" if state_fips == 30
replace state = "NE" if state_fips == 31
replace state = "NV" if state_fips == 32
replace state = "NH" if state_fips == 33
replace state = "NJ" if state_fips == 34
replace state = "NM" if state_fips == 35
replace state = "NY" if state_fips == 36
replace state = "NC" if state_fips == 37
replace state = "ND" if state_fips == 38
replace state = "OH" if state_fips == 39
replace state = "OK" if state_fips == 40
replace state = "OR" if state_fips == 41
replace state = "PA" if state_fips == 42
replace state = "RI" if state_fips == 44
replace state = "SC" if state_fips == 45
replace state = "SD" if state_fips == 46
replace state = "TN" if state_fips == 47
replace state = "TX" if state_fips == 48
replace state = "UT" if state_fips == 49
replace state = "VT" if state_fips == 50
replace state = "VA" if state_fips == 51
replace state = "WA" if state_fips == 53
replace state = "WV" if state_fips == 54
replace state = "WI" if state_fips == 55
replace state = "WY" if state_fips == 56


generate region = 0 if inlist(state, "PA", "NY", "VT", "NH", "NJ", "MA", "CT", "RI", "ME")
replace region = 1 if inlist(state, "AK", "WA", "OR", "CA", "ID")
replace region = 1 if inlist(state,"NV", "MT", "WY", "UT", "AZ", "CO", "NM")
replace region = 2 if inlist(state, "ND", "SD", "NE", "KS", "MN", "IA")
replace region = 2 if inlist(state,"MO", "WI", "IL", "IN", "MI", "OH")
replace region = 3 if inlist(state, "OK", "TX", "AR", "LA", "KY", "TN","NC", "SC") 
replace region = 3 if inlist(state,"MS", "AL", "GA", "FL", "WV", "MD", "DC", "VA") 

*New England
generate division = 0 if inlist(state, "VT", "NH", "MA", "CT", "RI", "ME")
*Middle Atlantic
replace division = 1 if inlist(state, "PA", "NY", "NJ")
*Pacific
replace division = 2 if inlist(state, "AK", "WA", "OR", "CA", "HI")
*Mountain
replace division = 3 if inlist(state,"NV", "MT", "WY", "UT", "AZ", "CO", "NM", "ID")
*East North Central
replace division = 4 if inlist(state, "IN", "IL", "MI", "OH", "WI")
*West North Central
replace division = 5 if inlist(state,"IA", "KS", "MN", "MO", "NE", "ND", "SD")
*South Atlantic
replace division = 6 if inlist(state, "DE", "DC", "FL", "GA", "MD", "NC", "SC", "VA", "WV")
*East South Central 
replace division = 7 if inlist(state,"MS", "AL", "GA", "TN")
*West South Central 
replace division = 8 if inlist(state,"AR", "LA", "OK", "TX")




*mask mandate variable based on Westyn's data
*this is a dummy variable for whether there was a mask mandate as of August 2020
generate mask_mandate_westyn = 0
replace mask_mandate_westyn = 1 if inlist(state, "AL", "AK", "CA", "")



**MASK MANDATE VARIABLE FROM AUSTIN WRIGHT
merge m:1 fips using "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Mask Mandate County - 210406.dta", generate(_merge_mask_mandate)

keep if _merge_mask_mandate==3

generate mask_mandate_wright = 0
replace mask_mandate_wright = 1 if stata_date >= earliest_start_edate


generate mask_mandate_wright_opening = 0 if week_from_opening_7_5_2 == 0
replace mask_mandate_wright_opening = 1 if stata_date >= earliest_start_edate & week_from_opening_7_5_2 == 0

egen mask_mandate_wright_opening_all = min(mask_mandate_wright_opening), by(fips)

*bar graphs
*no mask mandate

generate region_0 = 1 if region == 0
generate region_1 = 1 if region == 1
generate region_2 = 1 if region == 2
generate region_3 = 1 if region == 3

graph bar (count) mask_mandate_wright_opening, over(state, label(labsize(small))) bar(1, fcolor(bluishgray8) lcolor(gs5))  graphregion(fcolor(white) ifcolor(white))  blabel(total), if mask_mandate_wright_opening == 0
graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Histogram - State Counts No Mask Mandate Wright - 210406.gph", replace
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Histogram - State Counts No Mask Mandate Wright - 210406.jpg", as(jpg) name("Graph") quality(90)

*mask mandate
graph bar (count) mask_mandate_wright_opening, over(state, label(labsize(small))) bar(1, fcolor(bluishgray8) lcolor(gs5))  graphregion(fcolor(white) ifcolor(white))  blabel(total), if mask_mandate_wright_opening == 1
graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Histogram - State Counts Mask Mandate Wright - 210406.gph", replace
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Histogram - State Counts Mask Mandate Wright - 210406.jpg", as(jpg) name("Graph") quality(90)



*School opening mode dummies
generate open1_mean_cat_all_v = 0 if open1_mean_cat_all == 1 | open1_mean_cat_all == 2
replace open1_mean_cat_all_v = 1 if open1_mean_cat_all == 0

generate open1_mean_cat_all_h = 0 if open1_mean_cat_all == 0 | open1_mean_cat_all == 2
replace open1_mean_cat_all_h = 1 if open1_mean_cat_all == 1

generate open1_mean_cat_all_t = 0 if open1_mean_cat_all == 0 | open1_mean_cat_all == 1
replace open1_mean_cat_all_t = 1 if open1_mean_cat_all == 2


*School mode dummies interacted with weeks
generate week_from_opening_7_5_2_v = open1_mean_cat_all_v*week_from_opening_7_5_2
generate week_from_opening_7_5_2_h = open1_mean_cat_all_h*week_from_opening_7_5_2
generate week_from_opening_7_5_2_t = open1_mean_cat_all_t*week_from_opening_7_5_2


**HISTOGRAMS
histogram cases_per_pop if week_from_opening_7_5_2 != ., fcolor(bluishgray8) lcolor(gs5) graphregion(fcolor(white))
graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Histogram - Cases per Capita - 210323.gph", replace
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Histogram - Cases per Capita - 210323.jpg", as(jpg) name("Graph") quality(90)

histogram cases_per_pop_log if week_from_opening_7_5_2 != ., fcolor(bluishgray8) lcolor(gs5) graphregion(fcolor(white))
graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Histogram - Log Cases per Capita - 210323.gph", replace
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Histogram - Log Cases per Capita - 210323.jpg", as(jpg) name("Graph") quality(90)

histogram cases_per_pop_bl_diff if week_from_opening_7_5_2 != ., fcolor(bluishgray8) lcolor(gs5) graphregion(fcolor(white))
graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Histogram - Difference in Cases per Capita from Baseline - 210323.gph", replace
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Histogram - Difference in Cases per Capita from Baseline - 210323.jpg", as(jpg) name("Graph") quality(100)


*counts of school types by region
generate open1_mean_cat_virtual = 1 if open1_mean_cat == 0
generate open1_mean_cat_hybrid = 1 if open1_mean_cat == 1
generate open1_mean_cat_traditional = 1 if open1_mean_cat == 2

generate region_text = "Northeast" if region == 0
replace region_text = "West" if region == 1
replace region_text = "Midwest" if region == 2
replace region_text = "South" if region == 3

*bar graph
graph bar (count) open1_mean_cat_virtual open1_mean_cat_hybrid open1_mean_cat_traditional, over(region_text, label(labsize(small))) bar(1, fcolor(bluishgray8) lcolor(gs5)) bar(2, fcolor(gs10) lcolor(gs5)) bar(3, fcolor(gs5) lcolor(gs5)) graphregion(fcolor(white) ifcolor(white)) legend(label(1 "Virtual") label(2 "Hybrid") label(3 "Traditional")) blabel(total)
graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\School Mode Bar Graph - by region - 210323.gph", replace
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\School Mode Bar Graph - by region - 210323.jpg", as(jpg) name("Graph") quality(100)



*counts of school types by region/division
generate region_division = 0 if region == 0
replace region_division = 1 if region == 2
replace region_division = 2 if region == 3
replace region_division = 3 if division == 3
replace region_division = 4 if division == 2

generate region_division_text = "Northeast" if region_division == 0
replace region_division_text = "Midwest" if region_division == 1
replace region_division_text = "South" if region_division == 2
replace region_division_text = "Mountain" if region_division == 3
replace region_division_text = "Pacific" if region_division == 4

tab open1_mean_cat_traditional if state == "CA"
tab open1_mean_cat_traditional if state == "WA"
tab open1_mean_cat_traditional if state == "OR"

*bar graph
graph bar (count) open1_mean_cat_virtual open1_mean_cat_hybrid open1_mean_cat_traditional, over(region_division_text, label(labsize(small))) bar(1, fcolor(bluishgray8) lcolor(gs5)) bar(2, fcolor(gs10) lcolor(gs5)) bar(3, fcolor(gs5) lcolor(gs5)) graphregion(fcolor(white) ifcolor(white)) legend(label(1 "Virtual") label(2 "Hybrid") label(3 "Traditional")) blabel(total)

graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\School Mode Bar Graph - by region - 210323.gph", replace
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\School Mode Bar Graph - by region - 210323.jpg", as(jpg) name("Graph") quality(100)



**pulling out the counties and school mode so that Warren can create the map
*this gave 519 counties that were included in our analysis
*after running this line, i copied and pasted this into excel
br fips open1_mean_cat_all if week_from_opening_7_5_2 == 0 & region != . & open1_mean_cat_all != .

br fips open1_mean_cat_all region_division region_division_text if week_from_opening_7_5_2 == 0

*Westyn suggested highlighting the counties in which only elementary opened up. so I am creating a dummy variable for that here.
generate only_elementary_open = 0 if week_from_opening_7 == 1 & region != . & open1_mean_cat_all != .
replace only_elementary_open = 1 if open1_k5_t == 1 & open1_gr68_t == 0 & open1_gr912_t == 0 & week_from_opening_7 == 1 & region != . & open1_mean_cat_all != .

*applying this varible to all observations
egen only_elementary_open_all = min(only_elementary_open), by(fips)

br fips open1_mean_cat_all only_elementary_open_all if week_from_opening_7_5_2 == 0 & region != . 

**BAR GRAPHS OF SCHOOL START DATES
*NE
graph bar (count) if week_from_opening_7_5_2 == 0 & region_division == 0 & open1_mean_cat_all != ., over(date) bar(1, fcolor(gs8) lcolor(black))  graphregion(fcolor(white) ifcolor(white))  blabel(total) ytitle("Number of counties")

graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\School Start Week Bar Graph - NE - 210630.gph", replace
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\School Start Week Bar Graph - NE - 210630.jpg", as(jpg) name("Graph") quality(100)

*MW
graph bar (count) if week_from_opening_7_5_2 == 0 & region_division == 1 & open1_mean_cat_all != ., over(date) bar(1, fcolor(gs8) lcolor(black))  graphregion(fcolor(white) ifcolor(white))  blabel(total) ytitle("Number of counties")

graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\School Start Week Bar Graph - MW - 210630.gph", replace
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\School Start Week Bar Graph - MW - 210630.jpg", as(jpg) name("Graph") quality(100)

*S
graph bar (count) if week_from_opening_7_5_2 == 0 & region_division == 2 & open1_mean_cat_all != ., over(date) bar(1, fcolor(gs8) lcolor(black))  graphregion(fcolor(white) ifcolor(white))  blabel(total) ytitle("Number of counties")

graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\School Start Week Bar Graph - S - 210630.gph", replace
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\School Start Week Bar Graph - S - 210630.jpg", as(jpg) name("Graph") quality(100)

*Mountain
graph bar (count) if week_from_opening_7_5_2 == 0 & region_division == 3 & open1_mean_cat_all != ., over(date) bar(1, fcolor(gs8) lcolor(black))  graphregion(fcolor(white) ifcolor(white))  blabel(total) ytitle("Number of counties")

graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\School Start Week Bar Graph - W - 210630.gph", replace
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\School Start Week Bar Graph - W - 210630.jpg", as(jpg) name("Graph") quality(100)


*I couldn't figure out how to get the dates on the x-axis to sort properly so i just did these frequency counts and then exported them into Excel to create the graphs
tab date if week_from_opening_7_5_2 == 0 & region_division == 0 & open1_mean_cat_all != .
tab date if week_from_opening_7_5_2 == 0 & region_division == 1 & open1_mean_cat_all != .
tab date if week_from_opening_7_5_2 == 0 & region_division == 2 & open1_mean_cat_all != .
tab date if week_from_opening_7_5_2 == 0 & region_division == 3 & open1_mean_cat_all != .



*Table 1
*creating the Excel file
putexcel set "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\COVID School Analyses - Table 1 - 210428.xlsx", replace

*putting structure around the top horizontal axis of the table
*Row 2
putexcel A1="Table 1" A3="Characteristics" B2="Overall" D2="Northeast" F2="West" H2="Midwest" J2="South"

*Row 3
putexcel A3="Characteristics" B3="Mean/N" C3="SD/%" D3="Mean/N" E3="SD/%" F3="Mean/N" G3="SD/%" H3="Mean/N" I3="SD/%" J3="Mean/N" K3="SD/%"

*putting structure around the vertical axis
putexcel A4="Total" A5="Google mobility data" A6="Retail and recreation" A7="Grocery and pharmacy" A8="Workplaces" A9="Residential"
putexcel A10="Oxford policy variables" A11="Workplace closing" A12="Recommend closing" A13="Require closing (or work from home) for some sectors" A14="Require closing (or work from home) for all sectors but essential workplaces"
putexcel A15="Cancel public events" A16="No measures" A17="Recommend cancelling" A18="Require cancelling" 
putexcel A19="Restrictions on gatherings" A20="Restrictions on gatherings of >1000 people" A21="Restrictions on gatherings of 101-1000 people" A22="Restrictions on gatherings of 11-100 people" A23="Restrictions on gatherings of <11 people"
putexcel A24="Close public transport" A25="No measures" A26="Recommend closing (or significantly reduce volume of transport available)" A27="Require closing (or prohibit most from using it)" 
putexcel A28="Testing policy" A29="No testing policy" A30="Only those who both (a) have symptoms AND (b) meet specific criteria (eg key workers, admitted to hospital, came into contact with a known case, returned from overseas)" A31="Testing of anyone showing Covid-19 symptoms" A32="Open public testing (eg drive through testing available to asymptomatic people)"
putexcel A33="Contact tracing" A34="No contact tracing" A35="Limited contact tracing; not done for all cases" A36="Comprehensive contact tracing; done for all identified cases"
putexcel A37="Facial coverings" A38="Recommended" A39="Required in some specified shared/public spaces outside the home with other people present, or some situations when social distancing not possible" A40="Required in all shared/public spaces outside the home with other people present or all situations when social distancing not possible" A41="Required outside the home at all times regardless of location or presence of other people" 

***Table 1
**Overall
**total
tab region if week_from_opening_7_5_2 == 0 & open1_mean_cat_all != .
return list
putexcel B5="r(N)", nformat(number_sep)

**Google mobility data
sum retail_and_recreation_percent_ch if week_from_opening_7_5_2 == 0 & open1_mean_cat_all != .
return list
putexcel B6="r(mean)",nformat("#.#")
putexcel C6="r(sd)",nformat("#.#")

sum grocery_and_pharmacy_percent_cha if week_from_opening_7_5_2 == 0 & open1_mean_cat_all != .
return list
putexcel B7="r(mean)",nformat("#.#")
putexcel C7="r(sd)",nformat("#.#")

sum workplaces_percent_change_from_b if week_from_opening_7_5_2 == 0 & open1_mean_cat_all != .
return list
putexcel B8="r(mean)",nformat("#.#")
putexcel C8="r(sd)",nformat("#.#")

sum residential_percent_change_from_ if week_from_opening_7_5_2 == 0 & open1_mean_cat_all != .
return list
putexcel B9="r(mean)",nformat("#.#")
putexcel C9="r(sd)",nformat("#.#")

**Oxford policy variables
*C2
tab c2_workplaceclosing_cat if c2_workplaceclosing_cat == 0 & week_from_opening_7_5_2 == 0 & open1_mean_cat_all != .
return list
putexcel B12="r(N)", nformat(number_sep)
putexcel C12=formula(=B12/B4), nformat(percent_d2)

tab c2_workplaceclosing_cat if c2_workplaceclosing_cat == 1 & week_from_opening_7_5_2 == 0 & open1_mean_cat_all != .
return list
putexcel B13="r(N)", nformat(number_sep)
putexcel C13=formula(=B13/B4), nformat(percent_d2)

tab c2_workplaceclosing_cat if c2_workplaceclosing_cat == 2 & week_from_opening_7_5_2 == 0 & open1_mean_cat_all != .
return list
putexcel B14="r(N)", nformat(number_sep)
putexcel C14=formula(=B14/B4), nformat(percent_d2)

*C3
tab c3_cancelpublicevents_cat if c3_cancelpublicevents_cat == 0 & week_from_opening_7_5_2 == 0 & open1_mean_cat_all != .
return list
putexcel B16="r(N)", nformat(number_sep)
putexcel C16=formula(=B16/B4), nformat(percent_d2)

tab c3_cancelpublicevents_cat if c3_cancelpublicevents_cat == 1 & week_from_opening_7_5_2 == 0 & open1_mean_cat_all != .
return list
putexcel B17="r(N)", nformat(number_sep)
putexcel C17=formula(=B17/B4), nformat(percent_d2)

tab c3_cancelpublicevents_cat if c3_cancelpublicevents_cat == 2 & week_from_opening_7_5_2 == 0 & open1_mean_cat_all != .
return list
putexcel B18="r(N)", nformat(number_sep)
putexcel C18=formula(=B18/B4), nformat(percent_d2)

*C4
tab c4_restrictionsongatherings_cat if c4_restrictionsongatherings_cat == 0 & week_from_opening_7_5_2 == 0 & open1_mean_cat_all != .
return list
putexcel B20="r(N)", nformat(number_sep)
putexcel C20=formula(=B20/B4), nformat(percent_d2)

tab c4_restrictionsongatherings_cat if c4_restrictionsongatherings_cat == 1 & week_from_opening_7_5_2 == 0 & open1_mean_cat_all != .
return list
putexcel B21="r(N)", nformat(number_sep)
putexcel C21=formula(=B21/B4), nformat(percent_d2)

tab c4_restrictionsongatherings_cat if c4_restrictionsongatherings_cat == 2 & week_from_opening_7_5_2 == 0 & open1_mean_cat_all != .
return list
putexcel B22="r(N)", nformat(number_sep)
putexcel C22=formula(=B22/B4), nformat(percent_d2)

tab c4_restrictionsongatherings_cat if c4_restrictionsongatherings_cat == 3 & week_from_opening_7_5_2 == 0 & open1_mean_cat_all != .
return list
putexcel B23="r(N)", nformat(number_sep)
putexcel C23=formula(=B23/B4), nformat(percent_d2)

*C5
tab c5_closepublictransport_cat if c5_closepublictransport_cat == 0 & week_from_opening_7_5_2 == 0 & open1_mean_cat_all != .
return list
putexcel B25="r(N)", nformat(number_sep)
putexcel C25=formula(=B25/B4), nformat(percent_d2)

tab c5_closepublictransport_cat if c5_closepublictransport_cat == 1 & week_from_opening_7_5_2 == 0 & open1_mean_cat_all != .
return list
putexcel B26="r(N)", nformat(number_sep)
putexcel C26=formula(=B26/B4), nformat(percent_d2)

tab c5_closepublictransport_cat if c5_closepublictransport_cat == 2 & week_from_opening_7_5_2 == 0 & open1_mean_cat_all != .
return list
putexcel B27="r(N)", nformat(number_sep)
putexcel C27=formula(=B27/B4), nformat(percent_d2)

*H2
tab h2_testingpolicy_cat if h2_testingpolicy_cat == 0 & week_from_opening_7_5_2 == 0 & open1_mean_cat_all != .
return list
putexcel B29="r(N)", nformat(number_sep)
putexcel C29=formula(=B29/B4), nformat(percent_d2)

tab h2_testingpolicy_cat if h2_testingpolicy_cat == 1 & week_from_opening_7_5_2 == 0 & open1_mean_cat_all != .
return list
putexcel B30="r(N)", nformat(number_sep)
putexcel C30=formula(=B30/B4), nformat(percent_d2)

tab h2_testingpolicy_cat if h2_testingpolicy_cat == 2 & week_from_opening_7_5_2 == 0 & open1_mean_cat_all != .
return list
putexcel B31="r(N)", nformat(number_sep)
putexcel C31=formula(=B31/B4), nformat(percent_d2)

tab h2_testingpolicy_cat if h2_testingpolicy_cat == 3 & week_from_opening_7_5_2 == 0 & open1_mean_cat_all != .
return list
putexcel B32="r(N)", nformat(number_sep)
putexcel C32=formula(=B32/B4), nformat(percent_d2)

*H3
tab h3_contacttracing_cat if h3_contacttracing_cat == 0 & week_from_opening_7_5_2 == 0 & open1_mean_cat_all != .
return list
putexcel B34="r(N)", nformat(number_sep)
putexcel C34=formula(=B34/B4), nformat(percent_d2)

tab h3_contacttracing_cat if h3_contacttracing_cat == 1 & week_from_opening_7_5_2 == 0 & open1_mean_cat_all != .
return list
putexcel B35="r(N)", nformat(number_sep)
putexcel C35=formula(=B35/B4), nformat(percent_d2)

tab h3_contacttracing_cat if h3_contacttracing_cat == 2 & week_from_opening_7_5_2 == 0 & open1_mean_cat_all != .
return list
putexcel B36="r(N)", nformat(number_sep)
putexcel C36=formula(=B36/B4), nformat(percent_d2)

*H6
tab h6_facialcoverings_cat if h6_facialcoverings_cat == 0 & week_from_opening_7_5_2 == 0 & open1_mean_cat_all != .
return list
putexcel B38="r(N)", nformat(number_sep)
putexcel C38=formula(=B38/B4), nformat(percent_d2)

tab h6_facialcoverings_cat if h6_facialcoverings_cat == 1 & week_from_opening_7_5_2 == 0 & open1_mean_cat_all != .
return list
putexcel B39="r(N)", nformat(number_sep)
putexcel C39=formula(=B39/B4), nformat(percent_d2)

tab h6_facialcoverings_cat if h6_facialcoverings_cat == 2 & week_from_opening_7_5_2 == 0 & open1_mean_cat_all != .
return list
putexcel B40="r(N)", nformat(number_sep)
putexcel C40=formula(=B40/B4), nformat(percent_d2)

tab h6_facialcoverings_cat if h6_facialcoverings_cat == 3 & week_from_opening_7_5_2 == 0 & open1_mean_cat_all != .
return list
putexcel B41="r(N)", nformat(number_sep)
putexcel C41=formula(=B41/B4), nformat(percent_d2)



*race variables
generate sum_race = vare2 + vare3 + vare4 + vare5 + vare6 + vare7 + vare8

generate pct_white = vare2/vare1
generate pct_black = vare3/vare1
generate pct_nat_am = vare4/vare1
generate pct_asian = vare5/vare1
generate pct_other = (vare4 + vare5 + vare6 + vare7 + vare8)/vare1
generate pct_hispanic = vard3/vare1

**TABLE 1**
log using "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\COVID School Analyses - Table 1 - 210616.smcl", replace

**Overall
*race
sum pct_white if week_from_opening_7_5_2 == 0 & open1_mean_cat_all != . & region != . & region_division < 4
sum pct_black if week_from_opening_7_5_2 == 0 & open1_mean_cat_all != . & region != . & region_division < 4
sum pct_other if week_from_opening_7_5_2 == 0 & open1_mean_cat_all != . & region != . & region_division < 4
sum pct_hispanic if week_from_opening_7_5_2 == 0 & open1_mean_cat_all != . & region != . & region_division < 4

*median income
sum median_household_income_2019 if week_from_opening_7_5_2 == 0 & open1_mean_cat_all != . & region != . & region_division < 4

*urban/rural 
tab nchsurc_urban if week_from_opening_7_5_2 == 0 & open1_mean_cat_all != . & region != . & region_division < 4
tab metro if week_from_opening_7_5_2 == 0 & open1_mean_cat_all != . & region != . & region_division < 4

*Google mobility data
sum retail_and_recreation_percent_ch if week_from_opening_7_5_2 == 0 & open1_mean_cat_all != . & region != . & region_division < 4
sum grocery_and_pharmacy_percent_cha if week_from_opening_7_5_2 == 0 & open1_mean_cat_all != . & region != . & region_division < 4
sum workplaces_percent_change_from_b if week_from_opening_7_5_2 == 0 & open1_mean_cat_all != . & region != . & region_division < 4
sum residential_percent_change_from_ if week_from_opening_7_5_2 == 0 & open1_mean_cat_all != . & region != . & region_division < 4

*Oxford policy variables
tab c2_workplaceclosing_cat if week_from_opening_7_5_2 == 0 & open1_mean_cat_all != . & region != . & region_division < 4
tab c3_cancelpublicevents_cat if week_from_opening_7_5_2 == 0 & open1_mean_cat_all != . & region != . & region_division < 4
tab c4_restrictionsongatherings_cat if week_from_opening_7_5_2 == 0 & open1_mean_cat_all != . & region != . & region_division < 4
tab c5_closepublictransport_cat if week_from_opening_7_5_2 == 0 & open1_mean_cat_all != . & region != . & region_division < 4
tab h2_testingpolicy_cat if week_from_opening_7_5_2 == 0 & open1_mean_cat_all != . & region != . & region_division < 4
tab h3_contacttracing_cat if week_from_opening_7_5_2 == 0 & open1_mean_cat_all != . & region != . & region_division < 4
tab h6_facialcoverings_cat if week_from_opening_7_5_2 == 0 & open1_mean_cat_all != . & region != . & region_division < 4


**NE
*race
sum pct_white if week_from_opening_7_5_2 == 0 & region == 0 & open1_mean_cat_all != . & region != .
sum pct_black if week_from_opening_7_5_2 == 0 & region == 0 & open1_mean_cat_all != . & region != .
sum pct_other if week_from_opening_7_5_2 == 0 & region == 0 & open1_mean_cat_all != . & region != .
sum pct_hispanic if week_from_opening_7_5_2 == 0 & region == 0 & open1_mean_cat_all != . & region != .

*median income
sum median_household_income_2019 if week_from_opening_7_5_2 == 0 & region == 0 & open1_mean_cat_all != . & region != .

*urban/rural 
tab nchsurc_urban if week_from_opening_7_5_2 == 0 & region == 0 & open1_mean_cat_all != . & region != .
tab metro if week_from_opening_7_5_2 == 0 & region == 0 & open1_mean_cat_all != . & region != .

*Google mobility data
sum retail_and_recreation_percent_ch if week_from_opening_7_5_2 == 0 & region == 0 & open1_mean_cat_all != . & region != .
sum grocery_and_pharmacy_percent_cha if week_from_opening_7_5_2 == 0 & region == 0 & open1_mean_cat_all != . & region != .
sum workplaces_percent_change_from_b if week_from_opening_7_5_2 == 0 & region == 0 & open1_mean_cat_all != . & region != .
sum residential_percent_change_from_ if week_from_opening_7_5_2 == 0 & region == 0 & open1_mean_cat_all != . & region != .

*Oxford policy variables
tab c2_workplaceclosing_cat if week_from_opening_7_5_2 == 0 & region == 0 & open1_mean_cat_all != . & region != .
tab c3_cancelpublicevents_cat if week_from_opening_7_5_2 == 0 & region == 0 & open1_mean_cat_all != . & region != .
tab c4_restrictionsongatherings_cat if week_from_opening_7_5_2 == 0 & region == 0 & open1_mean_cat_all != . & region != .
tab c5_closepublictransport_cat if week_from_opening_7_5_2 == 0 & region == 0 & open1_mean_cat_all != . & region != .
tab h2_testingpolicy_cat if week_from_opening_7_5_2 == 0 & region == 0 & open1_mean_cat_all != . & region != .
tab h3_contacttracing_cat if week_from_opening_7_5_2 == 0 & region == 0 & open1_mean_cat_all != . & region != .
tab h6_facialcoverings_cat if week_from_opening_7_5_2 == 0 & region == 0 & open1_mean_cat_all != . & region != .


**W (Mountain)
*race
sum pct_white if week_from_opening_7_5_2 == 0 & region_division == 3 & open1_mean_cat_all != . & region != .
sum pct_black if week_from_opening_7_5_2 == 0 & region_division == 3 & open1_mean_cat_all != . & region != .
sum pct_other if week_from_opening_7_5_2 == 0 & region_division == 3 & open1_mean_cat_all != . & region != .
sum pct_hispanic if week_from_opening_7_5_2 == 0 & region_division == 3 & open1_mean_cat_all != . & region != .

*median income
sum median_household_income_2019 if week_from_opening_7_5_2 == 0 & region_division == 3 & open1_mean_cat_all != . & region != .

*urban/rural 
tab nchsurc_urban if week_from_opening_7_5_2 == 0 & region_division == 3 & open1_mean_cat_all != . & region != .
tab metro if week_from_opening_7_5_2 == 0 & region_division == 3 & open1_mean_cat_all != . & region != .

*Google mobility data
sum retail_and_recreation_percent_ch if week_from_opening_7_5_2 == 0 & region_division == 3 & open1_mean_cat_all != . & region != .
sum grocery_and_pharmacy_percent_cha if week_from_opening_7_5_2 == 0 & region_division == 3 & open1_mean_cat_all != . & region != .
sum workplaces_percent_change_from_b if week_from_opening_7_5_2 == 0 & region_division == 3 & open1_mean_cat_all != . & region != .
sum residential_percent_change_from_ if week_from_opening_7_5_2 == 0 & region_division == 3 & open1_mean_cat_all != . & region != .

*Oxford policy variables
tab c2_workplaceclosing_cat if week_from_opening_7_5_2 == 0 & region_division == 3 & open1_mean_cat_all != . & region != .
tab c3_cancelpublicevents_cat if week_from_opening_7_5_2 == 0 & region_division == 3 & open1_mean_cat_all != . & region != .
tab c4_restrictionsongatherings_cat if week_from_opening_7_5_2 == 0 & region_division == 3 & open1_mean_cat_all != . & region != .
tab c5_closepublictransport_cat if week_from_opening_7_5_2 == 0 & region_division == 3 & open1_mean_cat_all != . & region != .
tab h2_testingpolicy_cat if week_from_opening_7_5_2 == 0 & region_division == 3 & open1_mean_cat_all != . & region != .
tab h3_contacttracing_cat if week_from_opening_7_5_2 == 0 & region_division == 3 & open1_mean_cat_all != . & region != .
tab h6_facialcoverings_cat if week_from_opening_7_5_2 == 0 & region_division == 3 & open1_mean_cat_all != . & region != .


**MW
*race
sum pct_white if week_from_opening_7_5_2 == 0 & region == 2 & open1_mean_cat_all != . & region != .
sum pct_black if week_from_opening_7_5_2 == 0 & region == 2 & open1_mean_cat_all != . & region != .
sum pct_other if week_from_opening_7_5_2 == 0 & region == 2 & open1_mean_cat_all != . & region != .
sum pct_hispanic if week_from_opening_7_5_2 == 0 & region == 2 & open1_mean_cat_all != . & region != .

*median income
sum median_household_income_2019 if week_from_opening_7_5_2 == 0 & region == 2 & open1_mean_cat_all != . & region != .

*urban/rural 
tab nchsurc_urban if week_from_opening_7_5_2 == 0 & region == 2 & open1_mean_cat_all != . & region != .
tab metro if week_from_opening_7_5_2 == 0 & region == 2 & open1_mean_cat_all != . & region != .

*Google mobility data
sum retail_and_recreation_percent_ch if week_from_opening_7_5_2 == 0 & region == 2 & open1_mean_cat_all != . & region != .
sum grocery_and_pharmacy_percent_cha if week_from_opening_7_5_2 == 0 & region == 2 & open1_mean_cat_all != . & region != .
sum workplaces_percent_change_from_b if week_from_opening_7_5_2 == 0 & region == 2 & open1_mean_cat_all != . & region != .
sum residential_percent_change_from_ if week_from_opening_7_5_2 == 0 & region == 2 & open1_mean_cat_all != . & region != .

*Oxford policy variables
tab c2_workplaceclosing_cat if week_from_opening_7_5_2 == 0 & region == 2 & open1_mean_cat_all != . & region != .
tab c3_cancelpublicevents_cat if week_from_opening_7_5_2 == 0 & region == 2 & open1_mean_cat_all != . & region != .
tab c4_restrictionsongatherings_cat if week_from_opening_7_5_2 == 0 & region == 2 & open1_mean_cat_all != . & region != .
tab c5_closepublictransport_cat if week_from_opening_7_5_2 == 0 & region == 2 & open1_mean_cat_all != . & region != .
tab h2_testingpolicy_cat if week_from_opening_7_5_2 == 0 & region == 2 & open1_mean_cat_all != . & region != .
tab h3_contacttracing_cat if week_from_opening_7_5_2 == 0 & region == 2 & open1_mean_cat_all != . & region != .
tab h6_facialcoverings_cat if week_from_opening_7_5_2 == 0 & region == 2 & open1_mean_cat_all != . & region != .


**S
*race
sum pct_white if week_from_opening_7_5_2 == 0 & region == 3 & open1_mean_cat_all != . & region != .
sum pct_black if week_from_opening_7_5_2 == 0 & region == 3 & open1_mean_cat_all != . & region != .
sum pct_other if week_from_opening_7_5_2 == 0 & region == 3 & open1_mean_cat_all != . & region != .
sum pct_hispanic if week_from_opening_7_5_2 == 0 & region == 3 & open1_mean_cat_all != . & region != .

*median income
sum median_household_income_2019 if week_from_opening_7_5_2 == 0 & region == 3 & open1_mean_cat_all != . & region != .

*urban/rural 
tab nchsurc_urban if week_from_opening_7_5_2 == 0 & region == 3 & open1_mean_cat_all != . & region != .
tab metro if week_from_opening_7_5_2 == 0 & region == 3 & open1_mean_cat_all != . & region != .

*Google mobility data
sum retail_and_recreation_percent_ch if week_from_opening_7_5_2 == 0 & region == 3 & open1_mean_cat_all != . & region != .
sum grocery_and_pharmacy_percent_cha if week_from_opening_7_5_2 == 0 & region == 3 & open1_mean_cat_all != . & region != .
sum workplaces_percent_change_from_b if week_from_opening_7_5_2 == 0 & region == 3 & open1_mean_cat_all != . & region != .
sum residential_percent_change_from_ if week_from_opening_7_5_2 == 0 & region == 3 & open1_mean_cat_all != . & region != .

*Oxford policy variables
tab c2_workplaceclosing_cat if week_from_opening_7_5_2 == 0 & region == 3 & open1_mean_cat_all != . & region != .
tab c3_cancelpublicevents_cat if week_from_opening_7_5_2 == 0 & region == 3 & open1_mean_cat_all != . & region != .
tab c4_restrictionsongatherings_cat if week_from_opening_7_5_2 == 0 & region == 3 & open1_mean_cat_all != . & region != .
tab c5_closepublictransport_cat if week_from_opening_7_5_2 == 0 & region == 3 & open1_mean_cat_all != . & region != .
tab h2_testingpolicy_cat if week_from_opening_7_5_2 == 0 & region == 3 & open1_mean_cat_all != . & region != .
tab h3_contacttracing_cat if week_from_opening_7_5_2 == 0 & region == 3 & open1_mean_cat_all != . & region != .
tab h6_facialcoverings_cat if week_from_opening_7_5_2 == 0 & region == 3 & open1_mean_cat_all != . & region != .




log using "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\COVID School Analyses - 210616.smcl", replace

***UNADJUSTED MEANS
**across all regions
*across all school types
mean deaths_per_pop_100K, over(week_from_opening_7_5_2)
mean cases_per_pop_100K, over(week_from_opening_7_5_2)

*by different school types
mean cases_per_pop_100K if open1_mean_cat_all == 0, over(week_from_opening_7_5_2)
mean cases_per_pop_100K if open1_mean_cat_all == 1, over(week_from_opening_7_5_2)
mean cases_per_pop_100K if open1_mean_cat_all == 2, over(week_from_opening_7_5_2)

mean deaths_per_pop_100K if open1_mean_cat_all == 0, over(week_from_opening_7_5_2)
mean deaths_per_pop_100K if open1_mean_cat_all == 1, over(week_from_opening_7_5_2)
mean deaths_per_pop_100K if open1_mean_cat_all == 2, over(week_from_opening_7_5_2)

**NE region
*across all school types
mean deaths_per_pop_100K if region == 0, over(week_from_opening_7_5_2)
mean cases_per_pop_100K if region == 0, over(week_from_opening_7_5_2)

*by different school types
mean cases_per_pop_100K if open1_mean_cat_all == 0 & region == 0, over(week_from_opening_7_5_2)
mean cases_per_pop_100K if open1_mean_cat_all == 1 & region == 0, over(week_from_opening_7_5_2)
mean cases_per_pop_100K if open1_mean_cat_all == 2 & region == 0, over(week_from_opening_7_5_2)

mean deaths_per_pop_100K if open1_mean_cat_all == 0 & region == 0, over(week_from_opening_7_5_2)
mean deaths_per_pop_100K if open1_mean_cat_all == 1 & region == 0, over(week_from_opening_7_5_2)
mean deaths_per_pop_100K if open1_mean_cat_all == 2 & region == 0, over(week_from_opening_7_5_2)

**W region (Mountain division only)
*across all school types
mean deaths_per_pop_100K if region_division == 3, over(week_from_opening_7_5_2)
mean cases_per_pop_100K if region_division == 3, over(week_from_opening_7_5_2)

*by different school types
mean cases_per_pop_100K if open1_mean_cat_all == 0 & region_division == 3, over(week_from_opening_7_5_2)
mean cases_per_pop_100K if open1_mean_cat_all == 1 & region_division == 3, over(week_from_opening_7_5_2)
mean cases_per_pop_100K if open1_mean_cat_all == 2 & region_division == 3, over(week_from_opening_7_5_2)

mean deaths_per_pop_100K if open1_mean_cat_all == 0 & region_division == 3, over(week_from_opening_7_5_2)
mean deaths_per_pop_100K if open1_mean_cat_all == 1 & region_division == 3, over(week_from_opening_7_5_2)
mean deaths_per_pop_100K if open1_mean_cat_all == 2 & region_division == 3, over(week_from_opening_7_5_2)


**MW region
*across all school types
mean deaths_per_pop_100K if region == 2, over(week_from_opening_7_5_2)
mean cases_per_pop_100K if region == 2, over(week_from_opening_7_5_2)

*by different school types
mean cases_per_pop_100K if open1_mean_cat_all == 0 & region == 2, over(week_from_opening_7_5_2)
mean cases_per_pop_100K if open1_mean_cat_all == 1 & region == 2, over(week_from_opening_7_5_2)
mean cases_per_pop_100K if open1_mean_cat_all == 2 & region == 2, over(week_from_opening_7_5_2)

mean deaths_per_pop_100K if open1_mean_cat_all == 0 & region == 2, over(week_from_opening_7_5_2)
mean deaths_per_pop_100K if open1_mean_cat_all == 1 & region == 2, over(week_from_opening_7_5_2)
mean deaths_per_pop_100K if open1_mean_cat_all == 2 & region == 2, over(week_from_opening_7_5_2)


**S region
*across all school types
mean deaths_per_pop_100K if region == 3, over(week_from_opening_7_5_2)
mean cases_per_pop_100K if region == 3, over(week_from_opening_7_5_2)

*by different school types
mean cases_per_pop_100K if open1_mean_cat_all == 0 & region == 3, over(week_from_opening_7_5_2)
mean cases_per_pop_100K if open1_mean_cat_all == 1 & region == 3, over(week_from_opening_7_5_2)
mean cases_per_pop_100K if open1_mean_cat_all == 2 & region == 3, over(week_from_opening_7_5_2)

mean deaths_per_pop_100K if open1_mean_cat_all == 0 & region == 3, over(week_from_opening_7_5_2)
mean deaths_per_pop_100K if open1_mean_cat_all == 1 & region == 3, over(week_from_opening_7_5_2)
mean deaths_per_pop_100K if open1_mean_cat_all == 2 & region == 3, over(week_from_opening_7_5_2)





generate hybrid_traditional = 0 if open1_mean_cat_all == 0
replace hybrid_traditional = 1 if open1_mean_cat_all == 1 | open1_mean_cat_all == 2

generate hybrid = 0 if open1_mean_cat_all == 0
replace hybrid = 1 if open1_mean_cat_all == 1

generate traditional = 0 if open1_mean_cat_all == 0
replace traditional = 1 if open1_mean_cat_all == 2





**creating the interaction term so it is easier to refer to it in the margins command
*hybrid
generate open1_mean_cat_all_1 = 0
replace open1_mean_cat_all_1 = 1 if open1_mean_cat_all == 1
replace open1_mean_cat_all_1 = . if open1_mean_cat_all == .

generate hybrid_week_from_opening_7_5_2 = open1_mean_cat_all_1*week_from_opening_7_5_2

*traditional
generate open1_mean_cat_all_2 = 0
replace open1_mean_cat_all_2 = 1 if open1_mean_cat_all == 2
replace open1_mean_cat_all_2 = . if open1_mean_cat_all == .

generate trad_week_from_opening_7_5_2 = open1_mean_cat_all_2*week_from_opening_7_5_2





log using "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\COVID School Analyses - 210524.smcl", replace

***by census division for W and region for the rest
**with state-week FEs
***log OLS THIS IS WHAT WE USED FOR THE FINAL MODELS***
**all ages
*NE
poisson cases_per_pop_100K i.open1_mean_cat_all i.week_from_opening_7_5_2 i.hybrid_week_from_opening_7_5_2 i.trad_week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if region == 0 & week_from_opening_7_5_2 < 18,  vce(robust)

margins, dydx(hybrid_week_from_opening_7_5_2) post

estimates store hybrid_NE_all


poisson cases_per_pop_100K i.open1_mean_cat_all i.week_from_opening_7_5_2 i.hybrid_week_from_opening_7_5_2 i.trad_week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if region == 0 & week_from_opening_7_5_2 < 18,  vce(robust)

margins, dydx(trad_week_from_opening_7_5_2) post

estimates store trad_NE_all

*plotting the coefficients
coefplot (hybrid_NE_all, label(Hybrid) mlcolor(black) mcolor(gs12) ciopts(recast(rcap) color(gs10)))   (trad_NE_all, label(Traditional) mlcolor(black) mcolor(gs2) ciopts(recast(rcap) color(gs2))), yline(0, lcolor(black) lpattern(dash)) vertical rename(1.hybrid_week_from_opening_7_5_2 = 1.trad_week_from_opening_7_5_2 2.hybrid_week_from_opening_7_5_2 = 2.trad_week_from_opening_7_5_2 3.hybrid_week_from_opening_7_5_2 = 3.trad_week_from_opening_7_5_2 4.hybrid_week_from_opening_7_5_2 = 4.trad_week_from_opening_7_5_2 5.hybrid_week_from_opening_7_5_2 = 5.trad_week_from_opening_7_5_2 6.hybrid_week_from_opening_7_5_2 = 6.trad_week_from_opening_7_5_2 7.hybrid_week_from_opening_7_5_2 = 7.trad_week_from_opening_7_5_2 8.hybrid_week_from_opening_7_5_2 = 8.trad_week_from_opening_7_5_2 9.hybrid_week_from_opening_7_5_2 = 9.trad_week_from_opening_7_5_2 10.hybrid_week_from_opening_7_5_2 = 10.trad_week_from_opening_7_5_2 11.hybrid_week_from_opening_7_5_2 = 11.trad_week_from_opening_7_5_2 12.hybrid_week_from_opening_7_5_2 = 12.trad_week_from_opening_7_5_2 13.hybrid_week_from_opening_7_5_2 = 13.trad_week_from_opening_7_5_2 14.hybrid_week_from_opening_7_5_2 = 14.trad_week_from_opening_7_5_2 15.hybrid_week_from_opening_7_5_2 = 15.trad_week_from_opening_7_5_2 16.hybrid_week_from_opening_7_5_2 = 16.trad_week_from_opening_7_5_2 17.hybrid_week_from_opening_7_5_2 = 17.trad_week_from_opening_7_5_2 18.hybrid_week_from_opening_7_5_2 = 18.trad_week_from_opening_7_5_2) coeflabels(1.trad_week_from_opening_7_5_2 = "-4" 2.trad_week_from_opening_7_5_2 = "-3" 3.trad_week_from_opening_7_5_2 = "-2" 4.trad_week_from_opening_7_5_2 = "-1" 5.trad_week_from_opening_7_5_2 = "0" 6.trad_week_from_opening_7_5_2 = "1" 7.trad_week_from_opening_7_5_2 = "2" 8.trad_week_from_opening_7_5_2 = "3" 9.trad_week_from_opening_7_5_2 = "4" 10.trad_week_from_opening_7_5_2 = "5" 11.trad_week_from_opening_7_5_2  = "6" 12.trad_week_from_opening_7_5_2 = "7" 13.trad_week_from_opening_7_5_2 = "8" 14.trad_week_from_opening_7_5_2 = "9" 15.trad_week_from_opening_7_5_2 = "10" 16.trad_week_from_opening_7_5_2 = "11" 17.trad_week_from_opening_7_5_2 = "12" 18.trad_week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)


graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Cases - NE - All Ages - 210601.gph"
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Cases - NE - All Ages - 210601.jpg", as(jpg) name("Graph") quality(100)




*Pacific
poisson cases_per_pop_100K i.open1_mean_cat_all i.week_from_opening_7_5_2 i.hybrid_week_from_opening_7_5_2 i.trad_week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if division == 2 & week_from_opening_7_5_2 < 18,  vce(robust)

margins, dydx(hybrid_week_from_opening_7_5_2) post

estimates store hybrid_W_P_all

poisson cases_per_pop_100K i.open1_mean_cat_all i.week_from_opening_7_5_2 i.hybrid_week_from_opening_7_5_2 i.trad_week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if division == 2 & week_from_opening_7_5_2 < 18,  vce(robust)

margins, dydx(trad_week_from_opening_7_5_2) post

estimates store trad_W_P_all


*plotting the coefficients
coefplot (hybrid_W_P_all, label(Hybrid) mlcolor(black) mcolor(gs12) ciopts(recast(rcap) color(gs10)))   (trad_W_P_all, label(Traditional) mlcolor(black) mcolor(gs2) ciopts(recast(rcap) color(gs2))), yline(0, lcolor(black) lpattern(dash)) vertical rename(1.hybrid_week_from_opening_7_5_2 = 1.trad_week_from_opening_7_5_2 2.hybrid_week_from_opening_7_5_2 = 2.trad_week_from_opening_7_5_2 3.hybrid_week_from_opening_7_5_2 = 3.trad_week_from_opening_7_5_2 4.hybrid_week_from_opening_7_5_2 = 4.trad_week_from_opening_7_5_2 5.hybrid_week_from_opening_7_5_2 = 5.trad_week_from_opening_7_5_2 6.hybrid_week_from_opening_7_5_2 = 6.trad_week_from_opening_7_5_2 7.hybrid_week_from_opening_7_5_2 = 7.trad_week_from_opening_7_5_2 8.hybrid_week_from_opening_7_5_2 = 8.trad_week_from_opening_7_5_2 9.hybrid_week_from_opening_7_5_2 = 9.trad_week_from_opening_7_5_2 10.hybrid_week_from_opening_7_5_2 = 10.trad_week_from_opening_7_5_2 11.hybrid_week_from_opening_7_5_2 = 11.trad_week_from_opening_7_5_2 12.hybrid_week_from_opening_7_5_2 = 12.trad_week_from_opening_7_5_2 13.hybrid_week_from_opening_7_5_2 = 13.trad_week_from_opening_7_5_2 14.hybrid_week_from_opening_7_5_2 = 14.trad_week_from_opening_7_5_2 15.hybrid_week_from_opening_7_5_2 = 15.trad_week_from_opening_7_5_2 16.hybrid_week_from_opening_7_5_2 = 16.trad_week_from_opening_7_5_2 17.hybrid_week_from_opening_7_5_2 = 17.trad_week_from_opening_7_5_2 18.hybrid_week_from_opening_7_5_2 = 18.trad_week_from_opening_7_5_2) coeflabels(1.trad_week_from_opening_7_5_2 = "-4" 2.trad_week_from_opening_7_5_2 = "-3" 3.trad_week_from_opening_7_5_2 = "-2" 4.trad_week_from_opening_7_5_2 = "-1" 5.trad_week_from_opening_7_5_2 = "0" 6.trad_week_from_opening_7_5_2 = "1" 7.trad_week_from_opening_7_5_2 = "2" 8.trad_week_from_opening_7_5_2 = "3" 9.trad_week_from_opening_7_5_2 = "4" 10.trad_week_from_opening_7_5_2 = "5" 11.trad_week_from_opening_7_5_2  = "6" 12.trad_week_from_opening_7_5_2 = "7" 13.trad_week_from_opening_7_5_2 = "8" 14.trad_week_from_opening_7_5_2 = "9" 15.trad_week_from_opening_7_5_2 = "10" 16.trad_week_from_opening_7_5_2 = "11" 17.trad_week_from_opening_7_5_2 = "12" 18.trad_week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)


graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Cases - W Pacific - All Ages - 210601.gph"
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Cases - W Pacific - All Ages - 210601.jpg", as(jpg) name("Graph") quality(100) replace



*Mountain
poisson cases_per_pop_100K i.open1_mean_cat_all i.week_from_opening_7_5_2 i.hybrid_week_from_opening_7_5_2 i.trad_week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if division == 3 & week_from_opening_7_5_2 < 18,  vce(robust)

margins, dydx(hybrid_week_from_opening_7_5_2) post

estimates store hybrid_W_M_all

poisson cases_per_pop_100K i.open1_mean_cat_all i.week_from_opening_7_5_2 i.hybrid_week_from_opening_7_5_2 i.trad_week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if division == 3 & week_from_opening_7_5_2 < 18,  vce(robust)

margins, dydx(trad_week_from_opening_7_5_2) post

estimates store trad_W_M_all


*plotting the coefficients
coefplot (hybrid_W_M_all, label(Hybrid) mlcolor(black) mcolor(gs12) ciopts(recast(rcap) color(gs10)))   (trad_W_M_all, label(Traditional) mlcolor(black) mcolor(gs2) ciopts(recast(rcap) color(gs2))), yline(0, lcolor(black) lpattern(dash)) vertical rename(1.hybrid_week_from_opening_7_5_2 = 1.trad_week_from_opening_7_5_2 2.hybrid_week_from_opening_7_5_2 = 2.trad_week_from_opening_7_5_2 3.hybrid_week_from_opening_7_5_2 = 3.trad_week_from_opening_7_5_2 4.hybrid_week_from_opening_7_5_2 = 4.trad_week_from_opening_7_5_2 5.hybrid_week_from_opening_7_5_2 = 5.trad_week_from_opening_7_5_2 6.hybrid_week_from_opening_7_5_2 = 6.trad_week_from_opening_7_5_2 7.hybrid_week_from_opening_7_5_2 = 7.trad_week_from_opening_7_5_2 8.hybrid_week_from_opening_7_5_2 = 8.trad_week_from_opening_7_5_2 9.hybrid_week_from_opening_7_5_2 = 9.trad_week_from_opening_7_5_2 10.hybrid_week_from_opening_7_5_2 = 10.trad_week_from_opening_7_5_2 11.hybrid_week_from_opening_7_5_2 = 11.trad_week_from_opening_7_5_2 12.hybrid_week_from_opening_7_5_2 = 12.trad_week_from_opening_7_5_2 13.hybrid_week_from_opening_7_5_2 = 13.trad_week_from_opening_7_5_2 14.hybrid_week_from_opening_7_5_2 = 14.trad_week_from_opening_7_5_2 15.hybrid_week_from_opening_7_5_2 = 15.trad_week_from_opening_7_5_2 16.hybrid_week_from_opening_7_5_2 = 16.trad_week_from_opening_7_5_2 17.hybrid_week_from_opening_7_5_2 = 17.trad_week_from_opening_7_5_2 18.hybrid_week_from_opening_7_5_2 = 18.trad_week_from_opening_7_5_2) coeflabels(1.trad_week_from_opening_7_5_2 = "-4" 2.trad_week_from_opening_7_5_2 = "-3" 3.trad_week_from_opening_7_5_2 = "-2" 4.trad_week_from_opening_7_5_2 = "-1" 5.trad_week_from_opening_7_5_2 = "0" 6.trad_week_from_opening_7_5_2 = "1" 7.trad_week_from_opening_7_5_2 = "2" 8.trad_week_from_opening_7_5_2 = "3" 9.trad_week_from_opening_7_5_2 = "4" 10.trad_week_from_opening_7_5_2 = "5" 11.trad_week_from_opening_7_5_2  = "6" 12.trad_week_from_opening_7_5_2 = "7" 13.trad_week_from_opening_7_5_2 = "8" 14.trad_week_from_opening_7_5_2 = "9" 15.trad_week_from_opening_7_5_2 = "10" 16.trad_week_from_opening_7_5_2 = "11" 17.trad_week_from_opening_7_5_2 = "12" 18.trad_week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)


graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Cases - W Mountain - All Ages - 210601.gph"
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Cases - W Mountain - All Ages - 210601.jpg", as(jpg) name("Graph") quality(100) replace


*MW
poisson cases_per_pop_100K i.open1_mean_cat_all i.week_from_opening_7_5_2 i.hybrid_week_from_opening_7_5_2 i.trad_week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if region == 2 & week_from_opening_7_5_2 < 18,  vce(robust)

margins, dydx(hybrid_week_from_opening_7_5_2)  post

estimates store hybrid_MW_all

poisson cases_per_pop_100K i.open1_mean_cat_all i.week_from_opening_7_5_2 i.hybrid_week_from_opening_7_5_2 i.trad_week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if region == 2 & week_from_opening_7_5_2 < 18,  vce(robust)

margins, dydx(trad_week_from_opening_7_5_2)  post

estimates store trad_MW_all

*plotting the coefficients
coefplot (hybrid_MW_all, label(Hybrid) mlcolor(black) mcolor(gs12) ciopts(recast(rcap) color(gs10)))   (trad_MW_all, label(Traditional) mlcolor(black) mcolor(gs2) ciopts(recast(rcap) color(gs2))), yline(0, lcolor(black) lpattern(dash)) vertical rename(1.hybrid_week_from_opening_7_5_2 = 1.trad_week_from_opening_7_5_2 2.hybrid_week_from_opening_7_5_2 = 2.trad_week_from_opening_7_5_2 3.hybrid_week_from_opening_7_5_2 = 3.trad_week_from_opening_7_5_2 4.hybrid_week_from_opening_7_5_2 = 4.trad_week_from_opening_7_5_2 5.hybrid_week_from_opening_7_5_2 = 5.trad_week_from_opening_7_5_2 6.hybrid_week_from_opening_7_5_2 = 6.trad_week_from_opening_7_5_2 7.hybrid_week_from_opening_7_5_2 = 7.trad_week_from_opening_7_5_2 8.hybrid_week_from_opening_7_5_2 = 8.trad_week_from_opening_7_5_2 9.hybrid_week_from_opening_7_5_2 = 9.trad_week_from_opening_7_5_2 10.hybrid_week_from_opening_7_5_2 = 10.trad_week_from_opening_7_5_2 11.hybrid_week_from_opening_7_5_2 = 11.trad_week_from_opening_7_5_2 12.hybrid_week_from_opening_7_5_2 = 12.trad_week_from_opening_7_5_2 13.hybrid_week_from_opening_7_5_2 = 13.trad_week_from_opening_7_5_2 14.hybrid_week_from_opening_7_5_2 = 14.trad_week_from_opening_7_5_2 15.hybrid_week_from_opening_7_5_2 = 15.trad_week_from_opening_7_5_2 16.hybrid_week_from_opening_7_5_2 = 16.trad_week_from_opening_7_5_2 17.hybrid_week_from_opening_7_5_2 = 17.trad_week_from_opening_7_5_2 18.hybrid_week_from_opening_7_5_2 = 18.trad_week_from_opening_7_5_2) coeflabels(1.trad_week_from_opening_7_5_2 = "-4" 2.trad_week_from_opening_7_5_2 = "-3" 3.trad_week_from_opening_7_5_2 = "-2" 4.trad_week_from_opening_7_5_2 = "-1" 5.trad_week_from_opening_7_5_2 = "0" 6.trad_week_from_opening_7_5_2 = "1" 7.trad_week_from_opening_7_5_2 = "2" 8.trad_week_from_opening_7_5_2 = "3" 9.trad_week_from_opening_7_5_2 = "4" 10.trad_week_from_opening_7_5_2 = "5" 11.trad_week_from_opening_7_5_2  = "6" 12.trad_week_from_opening_7_5_2 = "7" 13.trad_week_from_opening_7_5_2 = "8" 14.trad_week_from_opening_7_5_2 = "9" 15.trad_week_from_opening_7_5_2 = "10" 16.trad_week_from_opening_7_5_2 = "11" 17.trad_week_from_opening_7_5_2 = "12" 18.trad_week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)


graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Cases - MW - All Ages - 210601.gph"
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Cases - MW - All Ages - 210601.jpg", as(jpg) name("Graph") quality(100) replace


*S
poisson cases_per_pop_100K i.open1_mean_cat_all i.week_from_opening_7_5_2 i.hybrid_week_from_opening_7_5_2 i.trad_week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if region == 3 & week_from_opening_7_5_2 < 18,  vce(robust)

margins, dydx(hybrid_week_from_opening_7_5_2) post

estimates store hybrid_S_all

poisson cases_per_pop_100K i.open1_mean_cat_all i.week_from_opening_7_5_2 i.hybrid_week_from_opening_7_5_2 i.trad_week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if region == 3 & week_from_opening_7_5_2 < 18,  vce(robust)

margins, dydx(trad_week_from_opening_7_5_2) post

estimates store trad_S_all

*plotting the coefficients
coefplot (hybrid_S_all, label(Hybrid) mlcolor(black) mcolor(gs12) ciopts(recast(rcap) color(gs10)))   (trad_S_all, label(Traditional) mlcolor(black) mcolor(gs2) ciopts(recast(rcap) color(gs2))), yline(0, lcolor(black) lpattern(dash)) vertical rename(1.hybrid_week_from_opening_7_5_2 = 1.trad_week_from_opening_7_5_2 2.hybrid_week_from_opening_7_5_2 = 2.trad_week_from_opening_7_5_2 3.hybrid_week_from_opening_7_5_2 = 3.trad_week_from_opening_7_5_2 4.hybrid_week_from_opening_7_5_2 = 4.trad_week_from_opening_7_5_2 5.hybrid_week_from_opening_7_5_2 = 5.trad_week_from_opening_7_5_2 6.hybrid_week_from_opening_7_5_2 = 6.trad_week_from_opening_7_5_2 7.hybrid_week_from_opening_7_5_2 = 7.trad_week_from_opening_7_5_2 8.hybrid_week_from_opening_7_5_2 = 8.trad_week_from_opening_7_5_2 9.hybrid_week_from_opening_7_5_2 = 9.trad_week_from_opening_7_5_2 10.hybrid_week_from_opening_7_5_2 = 10.trad_week_from_opening_7_5_2 11.hybrid_week_from_opening_7_5_2 = 11.trad_week_from_opening_7_5_2 12.hybrid_week_from_opening_7_5_2 = 12.trad_week_from_opening_7_5_2 13.hybrid_week_from_opening_7_5_2 = 13.trad_week_from_opening_7_5_2 14.hybrid_week_from_opening_7_5_2 = 14.trad_week_from_opening_7_5_2 15.hybrid_week_from_opening_7_5_2 = 15.trad_week_from_opening_7_5_2 16.hybrid_week_from_opening_7_5_2 = 16.trad_week_from_opening_7_5_2 17.hybrid_week_from_opening_7_5_2 = 17.trad_week_from_opening_7_5_2 18.hybrid_week_from_opening_7_5_2 = 18.trad_week_from_opening_7_5_2) coeflabels(1.trad_week_from_opening_7_5_2 = "-4" 2.trad_week_from_opening_7_5_2 = "-3" 3.trad_week_from_opening_7_5_2 = "-2" 4.trad_week_from_opening_7_5_2 = "-1" 5.trad_week_from_opening_7_5_2 = "0" 6.trad_week_from_opening_7_5_2 = "1" 7.trad_week_from_opening_7_5_2 = "2" 8.trad_week_from_opening_7_5_2 = "3" 9.trad_week_from_opening_7_5_2 = "4" 10.trad_week_from_opening_7_5_2 = "5" 11.trad_week_from_opening_7_5_2  = "6" 12.trad_week_from_opening_7_5_2 = "7" 13.trad_week_from_opening_7_5_2 = "8" 14.trad_week_from_opening_7_5_2 = "9" 15.trad_week_from_opening_7_5_2 = "10" 16.trad_week_from_opening_7_5_2 = "11" 17.trad_week_from_opening_7_5_2 = "12" 18.trad_week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)


graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Cases - S - All Ages - 210601.gph"
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Cases - S - All Ages - 210601.jpg", as(jpg) name("Graph") quality(100) replace







**ages 0-9
*NE
poisson cases_per_pop_0_9_100K i.open1_mean_cat_all i.week_from_opening_7_5_2 i.hybrid_week_from_opening_7_5_2 i.trad_week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if region == 0 & week_from_opening_7_5_2 < 18,  vce(robust)

margins, dydx(hybrid_week_from_opening_7_5_2) post

estimates store hybrid_NE_0_9


poisson cases_per_pop_0_9_100K i.open1_mean_cat_all i.week_from_opening_7_5_2 i.hybrid_week_from_opening_7_5_2 i.trad_week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if region == 0 & week_from_opening_7_5_2 < 18,  vce(robust)

margins, dydx(trad_week_from_opening_7_5_2) post

estimates store trad_NE_0_9

*plotting the coefficients
coefplot (hybrid_NE_0_9, label(Hybrid) mlcolor(black) mcolor(gs12) ciopts(recast(rcap) color(gs10)))   (trad_NE_0_9, label(Traditional) mlcolor(black) mcolor(gs2) ciopts(recast(rcap) color(gs2))), yline(0, lcolor(black) lpattern(dash)) vertical rename(1.hybrid_week_from_opening_7_5_2 = 1.trad_week_from_opening_7_5_2 2.hybrid_week_from_opening_7_5_2 = 2.trad_week_from_opening_7_5_2 3.hybrid_week_from_opening_7_5_2 = 3.trad_week_from_opening_7_5_2 4.hybrid_week_from_opening_7_5_2 = 4.trad_week_from_opening_7_5_2 5.hybrid_week_from_opening_7_5_2 = 5.trad_week_from_opening_7_5_2 6.hybrid_week_from_opening_7_5_2 = 6.trad_week_from_opening_7_5_2 7.hybrid_week_from_opening_7_5_2 = 7.trad_week_from_opening_7_5_2 8.hybrid_week_from_opening_7_5_2 = 8.trad_week_from_opening_7_5_2 9.hybrid_week_from_opening_7_5_2 = 9.trad_week_from_opening_7_5_2 10.hybrid_week_from_opening_7_5_2 = 10.trad_week_from_opening_7_5_2 11.hybrid_week_from_opening_7_5_2 = 11.trad_week_from_opening_7_5_2 12.hybrid_week_from_opening_7_5_2 = 12.trad_week_from_opening_7_5_2 13.hybrid_week_from_opening_7_5_2 = 13.trad_week_from_opening_7_5_2 14.hybrid_week_from_opening_7_5_2 = 14.trad_week_from_opening_7_5_2 15.hybrid_week_from_opening_7_5_2 = 15.trad_week_from_opening_7_5_2 16.hybrid_week_from_opening_7_5_2 = 16.trad_week_from_opening_7_5_2 17.hybrid_week_from_opening_7_5_2 = 17.trad_week_from_opening_7_5_2 18.hybrid_week_from_opening_7_5_2 = 18.trad_week_from_opening_7_5_2) coeflabels(1.trad_week_from_opening_7_5_2 = "-4" 2.trad_week_from_opening_7_5_2 = "-3" 3.trad_week_from_opening_7_5_2 = "-2" 4.trad_week_from_opening_7_5_2 = "-1" 5.trad_week_from_opening_7_5_2 = "0" 6.trad_week_from_opening_7_5_2 = "1" 7.trad_week_from_opening_7_5_2 = "2" 8.trad_week_from_opening_7_5_2 = "3" 9.trad_week_from_opening_7_5_2 = "4" 10.trad_week_from_opening_7_5_2 = "5" 11.trad_week_from_opening_7_5_2  = "6" 12.trad_week_from_opening_7_5_2 = "7" 13.trad_week_from_opening_7_5_2 = "8" 14.trad_week_from_opening_7_5_2 = "9" 15.trad_week_from_opening_7_5_2 = "10" 16.trad_week_from_opening_7_5_2 = "11" 17.trad_week_from_opening_7_5_2 = "12" 18.trad_week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)


graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Cases - NE - 0-9 - 210615.gph"
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Cases - NE - 0-9 - 210615.jpg", as(jpg) name("Graph") quality(100)




*Pacific using OLS
reg cases_per_pop_0_9_100K i.open1_mean_cat_all i.week_from_opening_7_5_2 i.hybrid_week_from_opening_7_5_2 i.trad_week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if division == 2 & week_from_opening_7_5_2 < 18,  vce(robust)

estimates store hybrid_W_P_0_9

reg cases_per_pop_0_9_100K i.open1_mean_cat_all i.week_from_opening_7_5_2 i.hybrid_week_from_opening_7_5_2 i.trad_week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if division == 2 & week_from_opening_7_5_2 < 18,  vce(robust)

estimates store trad_W_P_0_9


*plotting the coefficients
coefplot (hybrid_W_P_0_9, keep(1.hybrid_week_from_opening_7_5_2 2.hybrid_week_from_opening_7_5_2 3.hybrid_week_from_opening_7_5_2 4.hybrid_week_from_opening_7_5_2 5.hybrid_week_from_opening_7_5_2 6.hybrid_week_from_opening_7_5_2 7.hybrid_week_from_opening_7_5_2 8.hybrid_week_from_opening_7_5_2 9.hybrid_week_from_opening_7_5_2 10.hybrid_week_from_opening_7_5_2 11.hybrid_week_from_opening_7_5_2 12.hybrid_week_from_opening_7_5_2 13.hybrid_week_from_opening_7_5_2 14.hybrid_week_from_opening_7_5_2 15.hybrid_week_from_opening_7_5_2 16.hybrid_week_from_opening_7_5_2 17.hybrid_week_from_opening_7_5_2 18.hybrid_week_from_opening_7_5_2) label(Hybrid) mlcolor(black) mcolor(gs12) ciopts(recast(rcap) color(gs10)))   (trad_W_P_0_9, keep(1.trad_week_from_opening_7_5_2 2.trad_week_from_opening_7_5_2 3.trad_week_from_opening_7_5_2 4.trad_week_from_opening_7_5_2 5.trad_week_from_opening_7_5_2 6.trad_week_from_opening_7_5_2 7.trad_week_from_opening_7_5_2 8.trad_week_from_opening_7_5_2 9.trad_week_from_opening_7_5_2 10.trad_week_from_opening_7_5_2 11.trad_week_from_opening_7_5_2 12.trad_week_from_opening_7_5_2 13.trad_week_from_opening_7_5_2 14.trad_week_from_opening_7_5_2 15.trad_week_from_opening_7_5_2 16.trad_week_from_opening_7_5_2 17.trad_week_from_opening_7_5_2 18.trad_week_from_opening_7_5_2) label(Traditional) mlcolor(black) mcolor(gs5) ciopts(recast(rcap) color(gs5))), yline(0, lcolor(black) lpattern(dash)) ylabel(-5(1)5) yscale(range(-5(1)5)) vertical rename(1.trad_week_from_opening_7_5_2 = 1.hybrid_week_from_opening_7_5_2 2.trad_week_from_opening_7_5_2 = 2.hybrid_week_from_opening_7_5_2 3.trad_week_from_opening_7_5_2 = 3.hybrid_week_from_opening_7_5_2 4.trad_week_from_opening_7_5_2 = 4.hybrid_week_from_opening_7_5_2 5.trad_week_from_opening_7_5_2 = 5.hybrid_week_from_opening_7_5_2 6.trad_week_from_opening_7_5_2 = 6.hybrid_week_from_opening_7_5_2 7.trad_week_from_opening_7_5_2 = 7.hybrid_week_from_opening_7_5_2 8.trad_week_from_opening_7_5_2 = 8.hybrid_week_from_opening_7_5_2 9.trad_week_from_opening_7_5_2 = 9.hybrid_week_from_opening_7_5_2 10.trad_week_from_opening_7_5_2 = 10.hybrid_week_from_opening_7_5_2 11.trad_week_from_opening_7_5_2 = 11.hybrid_week_from_opening_7_5_2 12.trad_week_from_opening_7_5_2 = 12.hybrid_week_from_opening_7_5_2 13.trad_week_from_opening_7_5_2 = 13.hybrid_week_from_opening_7_5_2 14.trad_week_from_opening_7_5_2 = 14.hybrid_week_from_opening_7_5_2 15.trad_week_from_opening_7_5_2 = 15.hybrid_week_from_opening_7_5_2 16.trad_week_from_opening_7_5_2 = 16.hybrid_week_from_opening_7_5_2 17.trad_week_from_opening_7_5_2 = 17.hybrid_week_from_opening_7_5_2 18.trad_week_from_opening_7_5_2 = 18.hybrid_week_from_opening_7_5_2) coeflabels(1.hybrid_week_from_opening_7_5_2 = "-4" 2.hybrid_week_from_opening_7_5_2 = "-3" 3.hybrid_week_from_opening_7_5_2 = "-2" 4.hybrid_week_from_opening_7_5_2 = "-1" 5.hybrid_week_from_opening_7_5_2 = "0" 6.hybrid_week_from_opening_7_5_2 = "1" 7.hybrid_week_from_opening_7_5_2 = "2" 8.hybrid_week_from_opening_7_5_2 = "3" 9.hybrid_week_from_opening_7_5_2 = "4" 10.hybrid_week_from_opening_7_5_2 = "5" 11.hybrid_week_from_opening_7_5_2  = "6" 12.hybrid_week_from_opening_7_5_2 = "7" 13.hybrid_week_from_opening_7_5_2 = "8" 14.hybrid_week_from_opening_7_5_2 = "9" 15.hybrid_week_from_opening_7_5_2 = "10" 16.hybrid_week_from_opening_7_5_2 = "11" 17.hybrid_week_from_opening_7_5_2 = "12" 18.hybrid_week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)



graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Cases - W Pacific - 0-9 - 210616.gph", replace
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Cases - W Pacific - 0-9 - 210616.jpg", as(jpg) name("Graph") quality(100) replace





*Mountain
poisson cases_per_pop_0_9_100K i.open1_mean_cat_all i.week_from_opening_7_5_2 i.hybrid_week_from_opening_7_5_2 i.trad_week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if division == 3 & week_from_opening_7_5_2 < 18,  vce(robust)

margins, dydx(hybrid_week_from_opening_7_5_2) post

estimates store hybrid_W_M_0_9

poisson cases_per_pop_0_9_100K i.open1_mean_cat_all i.week_from_opening_7_5_2 i.hybrid_week_from_opening_7_5_2 i.trad_week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if division == 3 & week_from_opening_7_5_2 < 18,  vce(robust)

margins, dydx(trad_week_from_opening_7_5_2) post

estimates store trad_W_M_0_9


*plotting the coefficients
coefplot (hybrid_W_M_0_9, label(Hybrid) mlcolor(black) mcolor(gs12) ciopts(recast(rcap) color(gs10)))   (trad_W_M_0_9, label(Traditional) mlcolor(black) mcolor(gs2) ciopts(recast(rcap) color(gs2))), yline(0, lcolor(black) lpattern(dash)) vertical rename(1.hybrid_week_from_opening_7_5_2 = 1.trad_week_from_opening_7_5_2 2.hybrid_week_from_opening_7_5_2 = 2.trad_week_from_opening_7_5_2 3.hybrid_week_from_opening_7_5_2 = 3.trad_week_from_opening_7_5_2 4.hybrid_week_from_opening_7_5_2 = 4.trad_week_from_opening_7_5_2 5.hybrid_week_from_opening_7_5_2 = 5.trad_week_from_opening_7_5_2 6.hybrid_week_from_opening_7_5_2 = 6.trad_week_from_opening_7_5_2 7.hybrid_week_from_opening_7_5_2 = 7.trad_week_from_opening_7_5_2 8.hybrid_week_from_opening_7_5_2 = 8.trad_week_from_opening_7_5_2 9.hybrid_week_from_opening_7_5_2 = 9.trad_week_from_opening_7_5_2 10.hybrid_week_from_opening_7_5_2 = 10.trad_week_from_opening_7_5_2 11.hybrid_week_from_opening_7_5_2 = 11.trad_week_from_opening_7_5_2 12.hybrid_week_from_opening_7_5_2 = 12.trad_week_from_opening_7_5_2 13.hybrid_week_from_opening_7_5_2 = 13.trad_week_from_opening_7_5_2 14.hybrid_week_from_opening_7_5_2 = 14.trad_week_from_opening_7_5_2 15.hybrid_week_from_opening_7_5_2 = 15.trad_week_from_opening_7_5_2 16.hybrid_week_from_opening_7_5_2 = 16.trad_week_from_opening_7_5_2 17.hybrid_week_from_opening_7_5_2 = 17.trad_week_from_opening_7_5_2 18.hybrid_week_from_opening_7_5_2 = 18.trad_week_from_opening_7_5_2) coeflabels(1.trad_week_from_opening_7_5_2 = "-4" 2.trad_week_from_opening_7_5_2 = "-3" 3.trad_week_from_opening_7_5_2 = "-2" 4.trad_week_from_opening_7_5_2 = "-1" 5.trad_week_from_opening_7_5_2 = "0" 6.trad_week_from_opening_7_5_2 = "1" 7.trad_week_from_opening_7_5_2 = "2" 8.trad_week_from_opening_7_5_2 = "3" 9.trad_week_from_opening_7_5_2 = "4" 10.trad_week_from_opening_7_5_2 = "5" 11.trad_week_from_opening_7_5_2  = "6" 12.trad_week_from_opening_7_5_2 = "7" 13.trad_week_from_opening_7_5_2 = "8" 14.trad_week_from_opening_7_5_2 = "9" 15.trad_week_from_opening_7_5_2 = "10" 16.trad_week_from_opening_7_5_2 = "11" 17.trad_week_from_opening_7_5_2 = "12" 18.trad_week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)


graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Cases - W Mountain - 0-9 - 210615.gph"
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Cases - W Mountain - 0-9 - 210615.jpg", as(jpg) name("Graph") quality(100) replace


*MW
poisson cases_per_pop_0_9_100K i.open1_mean_cat_all i.week_from_opening_7_5_2 i.hybrid_week_from_opening_7_5_2 i.trad_week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if region == 2 & week_from_opening_7_5_2 < 18,  vce(robust)

margins, dydx(hybrid_week_from_opening_7_5_2)  post

estimates store hybrid_MW_0_9

poisson cases_per_pop_0_9_100K i.open1_mean_cat_all i.week_from_opening_7_5_2 i.hybrid_week_from_opening_7_5_2 i.trad_week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if region == 2 & week_from_opening_7_5_2 < 18,  vce(robust)

margins, dydx(trad_week_from_opening_7_5_2)  post

estimates store trad_MW_0_9

*plotting the coefficients
coefplot (hybrid_MW_0_9, label(Hybrid) mlcolor(black) mcolor(gs12) ciopts(recast(rcap) color(gs10)))   (trad_MW_0_9, label(Traditional) mlcolor(black) mcolor(gs2) ciopts(recast(rcap) color(gs2))), yline(0, lcolor(black) lpattern(dash)) vertical rename(1.hybrid_week_from_opening_7_5_2 = 1.trad_week_from_opening_7_5_2 2.hybrid_week_from_opening_7_5_2 = 2.trad_week_from_opening_7_5_2 3.hybrid_week_from_opening_7_5_2 = 3.trad_week_from_opening_7_5_2 4.hybrid_week_from_opening_7_5_2 = 4.trad_week_from_opening_7_5_2 5.hybrid_week_from_opening_7_5_2 = 5.trad_week_from_opening_7_5_2 6.hybrid_week_from_opening_7_5_2 = 6.trad_week_from_opening_7_5_2 7.hybrid_week_from_opening_7_5_2 = 7.trad_week_from_opening_7_5_2 8.hybrid_week_from_opening_7_5_2 = 8.trad_week_from_opening_7_5_2 9.hybrid_week_from_opening_7_5_2 = 9.trad_week_from_opening_7_5_2 10.hybrid_week_from_opening_7_5_2 = 10.trad_week_from_opening_7_5_2 11.hybrid_week_from_opening_7_5_2 = 11.trad_week_from_opening_7_5_2 12.hybrid_week_from_opening_7_5_2 = 12.trad_week_from_opening_7_5_2 13.hybrid_week_from_opening_7_5_2 = 13.trad_week_from_opening_7_5_2 14.hybrid_week_from_opening_7_5_2 = 14.trad_week_from_opening_7_5_2 15.hybrid_week_from_opening_7_5_2 = 15.trad_week_from_opening_7_5_2 16.hybrid_week_from_opening_7_5_2 = 16.trad_week_from_opening_7_5_2 17.hybrid_week_from_opening_7_5_2 = 17.trad_week_from_opening_7_5_2 18.hybrid_week_from_opening_7_5_2 = 18.trad_week_from_opening_7_5_2) coeflabels(1.trad_week_from_opening_7_5_2 = "-4" 2.trad_week_from_opening_7_5_2 = "-3" 3.trad_week_from_opening_7_5_2 = "-2" 4.trad_week_from_opening_7_5_2 = "-1" 5.trad_week_from_opening_7_5_2 = "0" 6.trad_week_from_opening_7_5_2 = "1" 7.trad_week_from_opening_7_5_2 = "2" 8.trad_week_from_opening_7_5_2 = "3" 9.trad_week_from_opening_7_5_2 = "4" 10.trad_week_from_opening_7_5_2 = "5" 11.trad_week_from_opening_7_5_2  = "6" 12.trad_week_from_opening_7_5_2 = "7" 13.trad_week_from_opening_7_5_2 = "8" 14.trad_week_from_opening_7_5_2 = "9" 15.trad_week_from_opening_7_5_2 = "10" 16.trad_week_from_opening_7_5_2 = "11" 17.trad_week_from_opening_7_5_2 = "12" 18.trad_week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)


graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Cases - MW - 0-9 - 210615.gph"
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Cases - MW - 0-9 - 210615.jpg", as(jpg) name("Graph") quality(100) replace


*S
poisson cases_per_pop_0_9_100K i.open1_mean_cat_all i.week_from_opening_7_5_2 i.hybrid_week_from_opening_7_5_2 i.trad_week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if region == 3 & week_from_opening_7_5_2 < 18,  vce(robust)

margins, dydx(hybrid_week_from_opening_7_5_2) post

estimates store hybrid_S_0_9

poisson cases_per_pop_0_9_100K i.open1_mean_cat_all i.week_from_opening_7_5_2 i.hybrid_week_from_opening_7_5_2 i.trad_week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if region == 3 & week_from_opening_7_5_2 < 18,  vce(robust)

margins, dydx(trad_week_from_opening_7_5_2) post

estimates store trad_S_0_9

*plotting the coefficients
coefplot (hybrid_S_0_9, label(Hybrid) mlcolor(black) mcolor(gs12) ciopts(recast(rcap) color(gs10)))   (trad_S_0_9, label(Traditional) mlcolor(black) mcolor(gs2) ciopts(recast(rcap) color(gs2))), yline(0, lcolor(black) lpattern(dash)) vertical rename(1.hybrid_week_from_opening_7_5_2 = 1.trad_week_from_opening_7_5_2 2.hybrid_week_from_opening_7_5_2 = 2.trad_week_from_opening_7_5_2 3.hybrid_week_from_opening_7_5_2 = 3.trad_week_from_opening_7_5_2 4.hybrid_week_from_opening_7_5_2 = 4.trad_week_from_opening_7_5_2 5.hybrid_week_from_opening_7_5_2 = 5.trad_week_from_opening_7_5_2 6.hybrid_week_from_opening_7_5_2 = 6.trad_week_from_opening_7_5_2 7.hybrid_week_from_opening_7_5_2 = 7.trad_week_from_opening_7_5_2 8.hybrid_week_from_opening_7_5_2 = 8.trad_week_from_opening_7_5_2 9.hybrid_week_from_opening_7_5_2 = 9.trad_week_from_opening_7_5_2 10.hybrid_week_from_opening_7_5_2 = 10.trad_week_from_opening_7_5_2 11.hybrid_week_from_opening_7_5_2 = 11.trad_week_from_opening_7_5_2 12.hybrid_week_from_opening_7_5_2 = 12.trad_week_from_opening_7_5_2 13.hybrid_week_from_opening_7_5_2 = 13.trad_week_from_opening_7_5_2 14.hybrid_week_from_opening_7_5_2 = 14.trad_week_from_opening_7_5_2 15.hybrid_week_from_opening_7_5_2 = 15.trad_week_from_opening_7_5_2 16.hybrid_week_from_opening_7_5_2 = 16.trad_week_from_opening_7_5_2 17.hybrid_week_from_opening_7_5_2 = 17.trad_week_from_opening_7_5_2 18.hybrid_week_from_opening_7_5_2 = 18.trad_week_from_opening_7_5_2) coeflabels(1.trad_week_from_opening_7_5_2 = "-4" 2.trad_week_from_opening_7_5_2 = "-3" 3.trad_week_from_opening_7_5_2 = "-2" 4.trad_week_from_opening_7_5_2 = "-1" 5.trad_week_from_opening_7_5_2 = "0" 6.trad_week_from_opening_7_5_2 = "1" 7.trad_week_from_opening_7_5_2 = "2" 8.trad_week_from_opening_7_5_2 = "3" 9.trad_week_from_opening_7_5_2 = "4" 10.trad_week_from_opening_7_5_2 = "5" 11.trad_week_from_opening_7_5_2  = "6" 12.trad_week_from_opening_7_5_2 = "7" 13.trad_week_from_opening_7_5_2 = "8" 14.trad_week_from_opening_7_5_2 = "9" 15.trad_week_from_opening_7_5_2 = "10" 16.trad_week_from_opening_7_5_2 = "11" 17.trad_week_from_opening_7_5_2 = "12" 18.trad_week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)


graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Cases - S - 0-9 - 210615.gph"
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Cases - S - 0-9 - 210615.jpg", as(jpg) name("Graph") quality(100) replace













**ages 10-19
*NE
poisson cases_per_pop_10_19_100K i.open1_mean_cat_all i.week_from_opening_7_5_2 i.hybrid_week_from_opening_7_5_2 i.trad_week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if region == 0 & week_from_opening_7_5_2 < 18,  vce(robust)

margins, dydx(hybrid_week_from_opening_7_5_2) post

estimates store hybrid_NE_10_19


poisson cases_per_pop_10_19_100K i.open1_mean_cat_all i.week_from_opening_7_5_2 i.hybrid_week_from_opening_7_5_2 i.trad_week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if region == 0 & week_from_opening_7_5_2 < 18,  vce(robust)

margins, dydx(trad_week_from_opening_7_5_2) post

estimates store trad_NE_10_19

*plotting the coefficients
coefplot (hybrid_NE_10_19, label(Hybrid) mlcolor(black) mcolor(gs12) ciopts(recast(rcap) color(gs10)))   (trad_NE_10_19, label(Traditional) mlcolor(black) mcolor(gs2) ciopts(recast(rcap) color(gs2))), yline(0, lcolor(black) lpattern(dash)) vertical rename(1.hybrid_week_from_opening_7_5_2 = 1.trad_week_from_opening_7_5_2 2.hybrid_week_from_opening_7_5_2 = 2.trad_week_from_opening_7_5_2 3.hybrid_week_from_opening_7_5_2 = 3.trad_week_from_opening_7_5_2 4.hybrid_week_from_opening_7_5_2 = 4.trad_week_from_opening_7_5_2 5.hybrid_week_from_opening_7_5_2 = 5.trad_week_from_opening_7_5_2 6.hybrid_week_from_opening_7_5_2 = 6.trad_week_from_opening_7_5_2 7.hybrid_week_from_opening_7_5_2 = 7.trad_week_from_opening_7_5_2 8.hybrid_week_from_opening_7_5_2 = 8.trad_week_from_opening_7_5_2 9.hybrid_week_from_opening_7_5_2 = 9.trad_week_from_opening_7_5_2 10.hybrid_week_from_opening_7_5_2 = 10.trad_week_from_opening_7_5_2 11.hybrid_week_from_opening_7_5_2 = 11.trad_week_from_opening_7_5_2 12.hybrid_week_from_opening_7_5_2 = 12.trad_week_from_opening_7_5_2 13.hybrid_week_from_opening_7_5_2 = 13.trad_week_from_opening_7_5_2 14.hybrid_week_from_opening_7_5_2 = 14.trad_week_from_opening_7_5_2 15.hybrid_week_from_opening_7_5_2 = 15.trad_week_from_opening_7_5_2 16.hybrid_week_from_opening_7_5_2 = 16.trad_week_from_opening_7_5_2 17.hybrid_week_from_opening_7_5_2 = 17.trad_week_from_opening_7_5_2 18.hybrid_week_from_opening_7_5_2 = 18.trad_week_from_opening_7_5_2) coeflabels(1.trad_week_from_opening_7_5_2 = "-4" 2.trad_week_from_opening_7_5_2 = "-3" 3.trad_week_from_opening_7_5_2 = "-2" 4.trad_week_from_opening_7_5_2 = "-1" 5.trad_week_from_opening_7_5_2 = "0" 6.trad_week_from_opening_7_5_2 = "1" 7.trad_week_from_opening_7_5_2 = "2" 8.trad_week_from_opening_7_5_2 = "3" 9.trad_week_from_opening_7_5_2 = "4" 10.trad_week_from_opening_7_5_2 = "5" 11.trad_week_from_opening_7_5_2  = "6" 12.trad_week_from_opening_7_5_2 = "7" 13.trad_week_from_opening_7_5_2 = "8" 14.trad_week_from_opening_7_5_2 = "9" 15.trad_week_from_opening_7_5_2 = "10" 16.trad_week_from_opening_7_5_2 = "11" 17.trad_week_from_opening_7_5_2 = "12" 18.trad_week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)


graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Cases - NE - 10-19 - 210615.gph"
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Cases - NE - 10-19 - 210615.jpg", as(jpg) name("Graph") quality(100)




*Pacific using OLS
reg cases_per_pop_10_19_100K i.open1_mean_cat_all i.week_from_opening_7_5_2 i.hybrid_week_from_opening_7_5_2 i.trad_week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if division == 2 & week_from_opening_7_5_2 < 18,  vce(robust)

estimates store hybrid_W_P_10_19

reg cases_per_pop_10_19_100K i.open1_mean_cat_all i.week_from_opening_7_5_2 i.hybrid_week_from_opening_7_5_2 i.trad_week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if division == 2 & week_from_opening_7_5_2 < 18,  vce(robust)

estimates store trad_W_P_10_19


*plotting the coefficients
coefplot (hybrid_W_P_10_19, keep(1.hybrid_week_from_opening_7_5_2 2.hybrid_week_from_opening_7_5_2 3.hybrid_week_from_opening_7_5_2 4.hybrid_week_from_opening_7_5_2 5.hybrid_week_from_opening_7_5_2 6.hybrid_week_from_opening_7_5_2 7.hybrid_week_from_opening_7_5_2 8.hybrid_week_from_opening_7_5_2 9.hybrid_week_from_opening_7_5_2 10.hybrid_week_from_opening_7_5_2 11.hybrid_week_from_opening_7_5_2 12.hybrid_week_from_opening_7_5_2 13.hybrid_week_from_opening_7_5_2 14.hybrid_week_from_opening_7_5_2 15.hybrid_week_from_opening_7_5_2 16.hybrid_week_from_opening_7_5_2 17.hybrid_week_from_opening_7_5_2 18.hybrid_week_from_opening_7_5_2) label(Hybrid) mlcolor(black) mcolor(gs12) ciopts(recast(rcap) color(gs10)))   (trad_W_P_10_19, keep(1.trad_week_from_opening_7_5_2 2.trad_week_from_opening_7_5_2 3.trad_week_from_opening_7_5_2 4.trad_week_from_opening_7_5_2 5.trad_week_from_opening_7_5_2 6.trad_week_from_opening_7_5_2 7.trad_week_from_opening_7_5_2 8.trad_week_from_opening_7_5_2 9.trad_week_from_opening_7_5_2 10.trad_week_from_opening_7_5_2 11.trad_week_from_opening_7_5_2 12.trad_week_from_opening_7_5_2 13.trad_week_from_opening_7_5_2 14.trad_week_from_opening_7_5_2 15.trad_week_from_opening_7_5_2 16.trad_week_from_opening_7_5_2 17.trad_week_from_opening_7_5_2 18.trad_week_from_opening_7_5_2) label(Traditional) mlcolor(black) mcolor(gs5) ciopts(recast(rcap) color(gs5))), yline(0, lcolor(black) lpattern(dash))  vertical rename(1.trad_week_from_opening_7_5_2 = 1.hybrid_week_from_opening_7_5_2 2.trad_week_from_opening_7_5_2 = 2.hybrid_week_from_opening_7_5_2 3.trad_week_from_opening_7_5_2 = 3.hybrid_week_from_opening_7_5_2 4.trad_week_from_opening_7_5_2 = 4.hybrid_week_from_opening_7_5_2 5.trad_week_from_opening_7_5_2 = 5.hybrid_week_from_opening_7_5_2 6.trad_week_from_opening_7_5_2 = 6.hybrid_week_from_opening_7_5_2 7.trad_week_from_opening_7_5_2 = 7.hybrid_week_from_opening_7_5_2 8.trad_week_from_opening_7_5_2 = 8.hybrid_week_from_opening_7_5_2 9.trad_week_from_opening_7_5_2 = 9.hybrid_week_from_opening_7_5_2 10.trad_week_from_opening_7_5_2 = 10.hybrid_week_from_opening_7_5_2 11.trad_week_from_opening_7_5_2 = 11.hybrid_week_from_opening_7_5_2 12.trad_week_from_opening_7_5_2 = 12.hybrid_week_from_opening_7_5_2 13.trad_week_from_opening_7_5_2 = 13.hybrid_week_from_opening_7_5_2 14.trad_week_from_opening_7_5_2 = 14.hybrid_week_from_opening_7_5_2 15.trad_week_from_opening_7_5_2 = 15.hybrid_week_from_opening_7_5_2 16.trad_week_from_opening_7_5_2 = 16.hybrid_week_from_opening_7_5_2 17.trad_week_from_opening_7_5_2 = 17.hybrid_week_from_opening_7_5_2 18.trad_week_from_opening_7_5_2 = 18.hybrid_week_from_opening_7_5_2) coeflabels(1.hybrid_week_from_opening_7_5_2 = "-4" 2.hybrid_week_from_opening_7_5_2 = "-3" 3.hybrid_week_from_opening_7_5_2 = "-2" 4.hybrid_week_from_opening_7_5_2 = "-1" 5.hybrid_week_from_opening_7_5_2 = "0" 6.hybrid_week_from_opening_7_5_2 = "1" 7.hybrid_week_from_opening_7_5_2 = "2" 8.hybrid_week_from_opening_7_5_2 = "3" 9.hybrid_week_from_opening_7_5_2 = "4" 10.hybrid_week_from_opening_7_5_2 = "5" 11.hybrid_week_from_opening_7_5_2  = "6" 12.hybrid_week_from_opening_7_5_2 = "7" 13.hybrid_week_from_opening_7_5_2 = "8" 14.hybrid_week_from_opening_7_5_2 = "9" 15.hybrid_week_from_opening_7_5_2 = "10" 16.hybrid_week_from_opening_7_5_2 = "11" 17.hybrid_week_from_opening_7_5_2 = "12" 18.hybrid_week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)



graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Cases - W Pacific - 10-19 - 210616.gph", replace
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Cases - W Pacific - 10-19 - 210616.jpg", as(jpg) name("Graph") quality(100) replace



*Mountain
poisson cases_per_pop_10_19_100K i.open1_mean_cat_all i.week_from_opening_7_5_2 i.hybrid_week_from_opening_7_5_2 i.trad_week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if division == 3 & week_from_opening_7_5_2 < 18,  vce(robust)

margins, dydx(hybrid_week_from_opening_7_5_2) post

estimates store hybrid_W_M_10_19

poisson cases_per_pop_10_19_100K i.open1_mean_cat_all i.week_from_opening_7_5_2 i.hybrid_week_from_opening_7_5_2 i.trad_week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if division == 3 & week_from_opening_7_5_2 < 18,  vce(robust)

margins, dydx(trad_week_from_opening_7_5_2) post

estimates store trad_W_M_10_19


*plotting the coefficients
coefplot (hybrid_W_M_10_19, label(Hybrid) mlcolor(black) mcolor(gs12) ciopts(recast(rcap) color(gs10)))   (trad_W_M_10_19, label(Traditional) mlcolor(black) mcolor(gs2) ciopts(recast(rcap) color(gs2))), yline(0, lcolor(black) lpattern(dash)) vertical rename(1.hybrid_week_from_opening_7_5_2 = 1.trad_week_from_opening_7_5_2 2.hybrid_week_from_opening_7_5_2 = 2.trad_week_from_opening_7_5_2 3.hybrid_week_from_opening_7_5_2 = 3.trad_week_from_opening_7_5_2 4.hybrid_week_from_opening_7_5_2 = 4.trad_week_from_opening_7_5_2 5.hybrid_week_from_opening_7_5_2 = 5.trad_week_from_opening_7_5_2 6.hybrid_week_from_opening_7_5_2 = 6.trad_week_from_opening_7_5_2 7.hybrid_week_from_opening_7_5_2 = 7.trad_week_from_opening_7_5_2 8.hybrid_week_from_opening_7_5_2 = 8.trad_week_from_opening_7_5_2 9.hybrid_week_from_opening_7_5_2 = 9.trad_week_from_opening_7_5_2 10.hybrid_week_from_opening_7_5_2 = 10.trad_week_from_opening_7_5_2 11.hybrid_week_from_opening_7_5_2 = 11.trad_week_from_opening_7_5_2 12.hybrid_week_from_opening_7_5_2 = 12.trad_week_from_opening_7_5_2 13.hybrid_week_from_opening_7_5_2 = 13.trad_week_from_opening_7_5_2 14.hybrid_week_from_opening_7_5_2 = 14.trad_week_from_opening_7_5_2 15.hybrid_week_from_opening_7_5_2 = 15.trad_week_from_opening_7_5_2 16.hybrid_week_from_opening_7_5_2 = 16.trad_week_from_opening_7_5_2 17.hybrid_week_from_opening_7_5_2 = 17.trad_week_from_opening_7_5_2 18.hybrid_week_from_opening_7_5_2 = 18.trad_week_from_opening_7_5_2) coeflabels(1.trad_week_from_opening_7_5_2 = "-4" 2.trad_week_from_opening_7_5_2 = "-3" 3.trad_week_from_opening_7_5_2 = "-2" 4.trad_week_from_opening_7_5_2 = "-1" 5.trad_week_from_opening_7_5_2 = "0" 6.trad_week_from_opening_7_5_2 = "1" 7.trad_week_from_opening_7_5_2 = "2" 8.trad_week_from_opening_7_5_2 = "3" 9.trad_week_from_opening_7_5_2 = "4" 10.trad_week_from_opening_7_5_2 = "5" 11.trad_week_from_opening_7_5_2  = "6" 12.trad_week_from_opening_7_5_2 = "7" 13.trad_week_from_opening_7_5_2 = "8" 14.trad_week_from_opening_7_5_2 = "9" 15.trad_week_from_opening_7_5_2 = "10" 16.trad_week_from_opening_7_5_2 = "11" 17.trad_week_from_opening_7_5_2 = "12" 18.trad_week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)


graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Cases - W Mountain - 10-19 - 210615.gph"
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Cases - W Mountain - 10-19 - 210615.jpg", as(jpg) name("Graph") quality(100) replace


*MW
poisson cases_per_pop_10_19_100K i.open1_mean_cat_all i.week_from_opening_7_5_2 i.hybrid_week_from_opening_7_5_2 i.trad_week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if region == 2 & week_from_opening_7_5_2 < 18,  vce(robust)

margins, dydx(hybrid_week_from_opening_7_5_2)  post

estimates store hybrid_MW_10_19

poisson cases_per_pop_10_19_100K i.open1_mean_cat_all i.week_from_opening_7_5_2 i.hybrid_week_from_opening_7_5_2 i.trad_week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if region == 2 & week_from_opening_7_5_2 < 18,  vce(robust)

margins, dydx(trad_week_from_opening_7_5_2)  post

estimates store trad_MW_10_19

*plotting the coefficients
coefplot (hybrid_MW_10_19, label(Hybrid) mlcolor(black) mcolor(gs12) ciopts(recast(rcap) color(gs10)))   (trad_MW_10_19, label(Traditional) mlcolor(black) mcolor(gs2) ciopts(recast(rcap) color(gs2))), yline(0, lcolor(black) lpattern(dash)) vertical rename(1.hybrid_week_from_opening_7_5_2 = 1.trad_week_from_opening_7_5_2 2.hybrid_week_from_opening_7_5_2 = 2.trad_week_from_opening_7_5_2 3.hybrid_week_from_opening_7_5_2 = 3.trad_week_from_opening_7_5_2 4.hybrid_week_from_opening_7_5_2 = 4.trad_week_from_opening_7_5_2 5.hybrid_week_from_opening_7_5_2 = 5.trad_week_from_opening_7_5_2 6.hybrid_week_from_opening_7_5_2 = 6.trad_week_from_opening_7_5_2 7.hybrid_week_from_opening_7_5_2 = 7.trad_week_from_opening_7_5_2 8.hybrid_week_from_opening_7_5_2 = 8.trad_week_from_opening_7_5_2 9.hybrid_week_from_opening_7_5_2 = 9.trad_week_from_opening_7_5_2 10.hybrid_week_from_opening_7_5_2 = 10.trad_week_from_opening_7_5_2 11.hybrid_week_from_opening_7_5_2 = 11.trad_week_from_opening_7_5_2 12.hybrid_week_from_opening_7_5_2 = 12.trad_week_from_opening_7_5_2 13.hybrid_week_from_opening_7_5_2 = 13.trad_week_from_opening_7_5_2 14.hybrid_week_from_opening_7_5_2 = 14.trad_week_from_opening_7_5_2 15.hybrid_week_from_opening_7_5_2 = 15.trad_week_from_opening_7_5_2 16.hybrid_week_from_opening_7_5_2 = 16.trad_week_from_opening_7_5_2 17.hybrid_week_from_opening_7_5_2 = 17.trad_week_from_opening_7_5_2 18.hybrid_week_from_opening_7_5_2 = 18.trad_week_from_opening_7_5_2) coeflabels(1.trad_week_from_opening_7_5_2 = "-4" 2.trad_week_from_opening_7_5_2 = "-3" 3.trad_week_from_opening_7_5_2 = "-2" 4.trad_week_from_opening_7_5_2 = "-1" 5.trad_week_from_opening_7_5_2 = "0" 6.trad_week_from_opening_7_5_2 = "1" 7.trad_week_from_opening_7_5_2 = "2" 8.trad_week_from_opening_7_5_2 = "3" 9.trad_week_from_opening_7_5_2 = "4" 10.trad_week_from_opening_7_5_2 = "5" 11.trad_week_from_opening_7_5_2  = "6" 12.trad_week_from_opening_7_5_2 = "7" 13.trad_week_from_opening_7_5_2 = "8" 14.trad_week_from_opening_7_5_2 = "9" 15.trad_week_from_opening_7_5_2 = "10" 16.trad_week_from_opening_7_5_2 = "11" 17.trad_week_from_opening_7_5_2 = "12" 18.trad_week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)


graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Cases - MW - 10-19 - 210615.gph"
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Cases - MW - 10-19 - 210615.jpg", as(jpg) name("Graph") quality(100) replace


*S
poisson cases_per_pop_10_19_100K i.open1_mean_cat_all i.week_from_opening_7_5_2 i.hybrid_week_from_opening_7_5_2 i.trad_week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if region == 3 & week_from_opening_7_5_2 < 18,  vce(robust)

margins, dydx(hybrid_week_from_opening_7_5_2) post

estimates store hybrid_S_10_19

poisson cases_per_pop_10_19_100K i.open1_mean_cat_all i.week_from_opening_7_5_2 i.hybrid_week_from_opening_7_5_2 i.trad_week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if region == 3 & week_from_opening_7_5_2 < 18,  vce(robust)

margins, dydx(trad_week_from_opening_7_5_2) post

estimates store trad_S_10_19

*plotting the coefficients
coefplot (hybrid_S_10_19, label(Hybrid) mlcolor(black) mcolor(gs12) ciopts(recast(rcap) color(gs10)))   (trad_S_10_19, label(Traditional) mlcolor(black) mcolor(gs2) ciopts(recast(rcap) color(gs2))), yline(0, lcolor(black) lpattern(dash)) vertical rename(1.hybrid_week_from_opening_7_5_2 = 1.trad_week_from_opening_7_5_2 2.hybrid_week_from_opening_7_5_2 = 2.trad_week_from_opening_7_5_2 3.hybrid_week_from_opening_7_5_2 = 3.trad_week_from_opening_7_5_2 4.hybrid_week_from_opening_7_5_2 = 4.trad_week_from_opening_7_5_2 5.hybrid_week_from_opening_7_5_2 = 5.trad_week_from_opening_7_5_2 6.hybrid_week_from_opening_7_5_2 = 6.trad_week_from_opening_7_5_2 7.hybrid_week_from_opening_7_5_2 = 7.trad_week_from_opening_7_5_2 8.hybrid_week_from_opening_7_5_2 = 8.trad_week_from_opening_7_5_2 9.hybrid_week_from_opening_7_5_2 = 9.trad_week_from_opening_7_5_2 10.hybrid_week_from_opening_7_5_2 = 10.trad_week_from_opening_7_5_2 11.hybrid_week_from_opening_7_5_2 = 11.trad_week_from_opening_7_5_2 12.hybrid_week_from_opening_7_5_2 = 12.trad_week_from_opening_7_5_2 13.hybrid_week_from_opening_7_5_2 = 13.trad_week_from_opening_7_5_2 14.hybrid_week_from_opening_7_5_2 = 14.trad_week_from_opening_7_5_2 15.hybrid_week_from_opening_7_5_2 = 15.trad_week_from_opening_7_5_2 16.hybrid_week_from_opening_7_5_2 = 16.trad_week_from_opening_7_5_2 17.hybrid_week_from_opening_7_5_2 = 17.trad_week_from_opening_7_5_2 18.hybrid_week_from_opening_7_5_2 = 18.trad_week_from_opening_7_5_2) coeflabels(1.trad_week_from_opening_7_5_2 = "-4" 2.trad_week_from_opening_7_5_2 = "-3" 3.trad_week_from_opening_7_5_2 = "-2" 4.trad_week_from_opening_7_5_2 = "-1" 5.trad_week_from_opening_7_5_2 = "0" 6.trad_week_from_opening_7_5_2 = "1" 7.trad_week_from_opening_7_5_2 = "2" 8.trad_week_from_opening_7_5_2 = "3" 9.trad_week_from_opening_7_5_2 = "4" 10.trad_week_from_opening_7_5_2 = "5" 11.trad_week_from_opening_7_5_2  = "6" 12.trad_week_from_opening_7_5_2 = "7" 13.trad_week_from_opening_7_5_2 = "8" 14.trad_week_from_opening_7_5_2 = "9" 15.trad_week_from_opening_7_5_2 = "10" 16.trad_week_from_opening_7_5_2 = "11" 17.trad_week_from_opening_7_5_2 = "12" 18.trad_week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)


graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Cases - S - 10-19 - 210615.gph"
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Cases - S - 10-19 - 210615.jpg", as(jpg) name("Graph") quality(100) replace








**ages 20+
*NE
poisson cases_per_pop_20_100K i.open1_mean_cat_all i.week_from_opening_7_5_2 i.hybrid_week_from_opening_7_5_2 i.trad_week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if region == 0 & week_from_opening_7_5_2 < 18,  vce(robust)

margins, dydx(hybrid_week_from_opening_7_5_2) post

estimates store hybrid_NE_20


poisson cases_per_pop_20_100K i.open1_mean_cat_all i.week_from_opening_7_5_2 i.hybrid_week_from_opening_7_5_2 i.trad_week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if region == 0 & week_from_opening_7_5_2 < 18,  vce(robust)

margins, dydx(trad_week_from_opening_7_5_2) post

estimates store trad_NE_20

*plotting the coefficients
coefplot (hybrid_NE_20, label(Hybrid) mlcolor(black) mcolor(gs12) ciopts(recast(rcap) color(gs10)))   (trad_NE_20, label(Traditional) mlcolor(black) mcolor(gs2) ciopts(recast(rcap) color(gs2))), yline(0, lcolor(black) lpattern(dash)) vertical rename(1.hybrid_week_from_opening_7_5_2 = 1.trad_week_from_opening_7_5_2 2.hybrid_week_from_opening_7_5_2 = 2.trad_week_from_opening_7_5_2 3.hybrid_week_from_opening_7_5_2 = 3.trad_week_from_opening_7_5_2 4.hybrid_week_from_opening_7_5_2 = 4.trad_week_from_opening_7_5_2 5.hybrid_week_from_opening_7_5_2 = 5.trad_week_from_opening_7_5_2 6.hybrid_week_from_opening_7_5_2 = 6.trad_week_from_opening_7_5_2 7.hybrid_week_from_opening_7_5_2 = 7.trad_week_from_opening_7_5_2 8.hybrid_week_from_opening_7_5_2 = 8.trad_week_from_opening_7_5_2 9.hybrid_week_from_opening_7_5_2 = 9.trad_week_from_opening_7_5_2 10.hybrid_week_from_opening_7_5_2 = 10.trad_week_from_opening_7_5_2 11.hybrid_week_from_opening_7_5_2 = 11.trad_week_from_opening_7_5_2 12.hybrid_week_from_opening_7_5_2 = 12.trad_week_from_opening_7_5_2 13.hybrid_week_from_opening_7_5_2 = 13.trad_week_from_opening_7_5_2 14.hybrid_week_from_opening_7_5_2 = 14.trad_week_from_opening_7_5_2 15.hybrid_week_from_opening_7_5_2 = 15.trad_week_from_opening_7_5_2 16.hybrid_week_from_opening_7_5_2 = 16.trad_week_from_opening_7_5_2 17.hybrid_week_from_opening_7_5_2 = 17.trad_week_from_opening_7_5_2 18.hybrid_week_from_opening_7_5_2 = 18.trad_week_from_opening_7_5_2) coeflabels(1.trad_week_from_opening_7_5_2 = "-4" 2.trad_week_from_opening_7_5_2 = "-3" 3.trad_week_from_opening_7_5_2 = "-2" 4.trad_week_from_opening_7_5_2 = "-1" 5.trad_week_from_opening_7_5_2 = "0" 6.trad_week_from_opening_7_5_2 = "1" 7.trad_week_from_opening_7_5_2 = "2" 8.trad_week_from_opening_7_5_2 = "3" 9.trad_week_from_opening_7_5_2 = "4" 10.trad_week_from_opening_7_5_2 = "5" 11.trad_week_from_opening_7_5_2  = "6" 12.trad_week_from_opening_7_5_2 = "7" 13.trad_week_from_opening_7_5_2 = "8" 14.trad_week_from_opening_7_5_2 = "9" 15.trad_week_from_opening_7_5_2 = "10" 16.trad_week_from_opening_7_5_2 = "11" 17.trad_week_from_opening_7_5_2 = "12" 18.trad_week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)


graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Cases - NE - 20+ - 210615.gph"
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Cases - NE - 20+ - 210615.jpg", as(jpg) name("Graph") quality(100)




*Pacific
poisson cases_per_pop_20_100K i.open1_mean_cat_all i.week_from_opening_7_5_2 i.hybrid_week_from_opening_7_5_2 i.trad_week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if division == 2 & week_from_opening_7_5_2 < 18,  vce(robust)

margins, dydx(hybrid_week_from_opening_7_5_2) post

estimates store hybrid_W_P_20

poisson cases_per_pop_20_100K i.open1_mean_cat_all i.week_from_opening_7_5_2 i.hybrid_week_from_opening_7_5_2 i.trad_week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if division == 2 & week_from_opening_7_5_2 < 18,  vce(robust)

margins, dydx(trad_week_from_opening_7_5_2) post

estimates store trad_W_P_20


*plotting the coefficients
coefplot (hybrid_W_P_20, label(Hybrid) mlcolor(black) mcolor(gs12) ciopts(recast(rcap) color(gs10)))   (trad_W_P_20, label(Traditional) mlcolor(black) mcolor(gs2) ciopts(recast(rcap) color(gs2))), yline(0, lcolor(black) lpattern(dash)) vertical rename(1.hybrid_week_from_opening_7_5_2 = 1.trad_week_from_opening_7_5_2 2.hybrid_week_from_opening_7_5_2 = 2.trad_week_from_opening_7_5_2 3.hybrid_week_from_opening_7_5_2 = 3.trad_week_from_opening_7_5_2 4.hybrid_week_from_opening_7_5_2 = 4.trad_week_from_opening_7_5_2 5.hybrid_week_from_opening_7_5_2 = 5.trad_week_from_opening_7_5_2 6.hybrid_week_from_opening_7_5_2 = 6.trad_week_from_opening_7_5_2 7.hybrid_week_from_opening_7_5_2 = 7.trad_week_from_opening_7_5_2 8.hybrid_week_from_opening_7_5_2 = 8.trad_week_from_opening_7_5_2 9.hybrid_week_from_opening_7_5_2 = 9.trad_week_from_opening_7_5_2 10.hybrid_week_from_opening_7_5_2 = 10.trad_week_from_opening_7_5_2 11.hybrid_week_from_opening_7_5_2 = 11.trad_week_from_opening_7_5_2 12.hybrid_week_from_opening_7_5_2 = 12.trad_week_from_opening_7_5_2 13.hybrid_week_from_opening_7_5_2 = 13.trad_week_from_opening_7_5_2 14.hybrid_week_from_opening_7_5_2 = 14.trad_week_from_opening_7_5_2 15.hybrid_week_from_opening_7_5_2 = 15.trad_week_from_opening_7_5_2 16.hybrid_week_from_opening_7_5_2 = 16.trad_week_from_opening_7_5_2 17.hybrid_week_from_opening_7_5_2 = 17.trad_week_from_opening_7_5_2 18.hybrid_week_from_opening_7_5_2 = 18.trad_week_from_opening_7_5_2) coeflabels(1.trad_week_from_opening_7_5_2 = "-4" 2.trad_week_from_opening_7_5_2 = "-3" 3.trad_week_from_opening_7_5_2 = "-2" 4.trad_week_from_opening_7_5_2 = "-1" 5.trad_week_from_opening_7_5_2 = "0" 6.trad_week_from_opening_7_5_2 = "1" 7.trad_week_from_opening_7_5_2 = "2" 8.trad_week_from_opening_7_5_2 = "3" 9.trad_week_from_opening_7_5_2 = "4" 10.trad_week_from_opening_7_5_2 = "5" 11.trad_week_from_opening_7_5_2  = "6" 12.trad_week_from_opening_7_5_2 = "7" 13.trad_week_from_opening_7_5_2 = "8" 14.trad_week_from_opening_7_5_2 = "9" 15.trad_week_from_opening_7_5_2 = "10" 16.trad_week_from_opening_7_5_2 = "11" 17.trad_week_from_opening_7_5_2 = "12" 18.trad_week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)


graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Cases - W Pacific - 20+ - 210615.gph"
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Cases - W Pacific - 20+ - 210615.jpg", as(jpg) name("Graph") quality(100) replace



*Mountain
poisson cases_per_pop_20_100K i.open1_mean_cat_all i.week_from_opening_7_5_2 i.hybrid_week_from_opening_7_5_2 i.trad_week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if division == 3 & week_from_opening_7_5_2 < 18,  vce(robust)

margins, dydx(hybrid_week_from_opening_7_5_2) post

estimates store hybrid_W_M_20

poisson cases_per_pop_20_100K i.open1_mean_cat_all i.week_from_opening_7_5_2 i.hybrid_week_from_opening_7_5_2 i.trad_week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if division == 3 & week_from_opening_7_5_2 < 18,  vce(robust)

margins, dydx(trad_week_from_opening_7_5_2) post

estimates store trad_W_M_20


*plotting the coefficients
coefplot (hybrid_W_M_20, label(Hybrid) mlcolor(black) mcolor(gs12) ciopts(recast(rcap) color(gs10)))   (trad_W_M_20, label(Traditional) mlcolor(black) mcolor(gs2) ciopts(recast(rcap) color(gs2))), yline(0, lcolor(black) lpattern(dash)) vertical rename(1.hybrid_week_from_opening_7_5_2 = 1.trad_week_from_opening_7_5_2 2.hybrid_week_from_opening_7_5_2 = 2.trad_week_from_opening_7_5_2 3.hybrid_week_from_opening_7_5_2 = 3.trad_week_from_opening_7_5_2 4.hybrid_week_from_opening_7_5_2 = 4.trad_week_from_opening_7_5_2 5.hybrid_week_from_opening_7_5_2 = 5.trad_week_from_opening_7_5_2 6.hybrid_week_from_opening_7_5_2 = 6.trad_week_from_opening_7_5_2 7.hybrid_week_from_opening_7_5_2 = 7.trad_week_from_opening_7_5_2 8.hybrid_week_from_opening_7_5_2 = 8.trad_week_from_opening_7_5_2 9.hybrid_week_from_opening_7_5_2 = 9.trad_week_from_opening_7_5_2 10.hybrid_week_from_opening_7_5_2 = 10.trad_week_from_opening_7_5_2 11.hybrid_week_from_opening_7_5_2 = 11.trad_week_from_opening_7_5_2 12.hybrid_week_from_opening_7_5_2 = 12.trad_week_from_opening_7_5_2 13.hybrid_week_from_opening_7_5_2 = 13.trad_week_from_opening_7_5_2 14.hybrid_week_from_opening_7_5_2 = 14.trad_week_from_opening_7_5_2 15.hybrid_week_from_opening_7_5_2 = 15.trad_week_from_opening_7_5_2 16.hybrid_week_from_opening_7_5_2 = 16.trad_week_from_opening_7_5_2 17.hybrid_week_from_opening_7_5_2 = 17.trad_week_from_opening_7_5_2 18.hybrid_week_from_opening_7_5_2 = 18.trad_week_from_opening_7_5_2) coeflabels(1.trad_week_from_opening_7_5_2 = "-4" 2.trad_week_from_opening_7_5_2 = "-3" 3.trad_week_from_opening_7_5_2 = "-2" 4.trad_week_from_opening_7_5_2 = "-1" 5.trad_week_from_opening_7_5_2 = "0" 6.trad_week_from_opening_7_5_2 = "1" 7.trad_week_from_opening_7_5_2 = "2" 8.trad_week_from_opening_7_5_2 = "3" 9.trad_week_from_opening_7_5_2 = "4" 10.trad_week_from_opening_7_5_2 = "5" 11.trad_week_from_opening_7_5_2  = "6" 12.trad_week_from_opening_7_5_2 = "7" 13.trad_week_from_opening_7_5_2 = "8" 14.trad_week_from_opening_7_5_2 = "9" 15.trad_week_from_opening_7_5_2 = "10" 16.trad_week_from_opening_7_5_2 = "11" 17.trad_week_from_opening_7_5_2 = "12" 18.trad_week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)


graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Cases - W Mountain - 20+ - 210615.gph"
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Cases - W Mountain - 20+ - 210615.jpg", as(jpg) name("Graph") quality(100) replace


*MW
poisson cases_per_pop_20_100K i.open1_mean_cat_all i.week_from_opening_7_5_2 i.hybrid_week_from_opening_7_5_2 i.trad_week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if region == 2 & week_from_opening_7_5_2 < 18,  vce(robust)

margins, dydx(hybrid_week_from_opening_7_5_2)  post

estimates store hybrid_MW_20

poisson cases_per_pop_20_100K i.open1_mean_cat_all i.week_from_opening_7_5_2 i.hybrid_week_from_opening_7_5_2 i.trad_week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if region == 2 & week_from_opening_7_5_2 < 18,  vce(robust)

margins, dydx(trad_week_from_opening_7_5_2)  post

estimates store trad_MW_20

*plotting the coefficients
coefplot (hybrid_MW_20, label(Hybrid) mlcolor(black) mcolor(gs12) ciopts(recast(rcap) color(gs10)))   (trad_MW_20, label(Traditional) mlcolor(black) mcolor(gs2) ciopts(recast(rcap) color(gs2))), yline(0, lcolor(black) lpattern(dash)) vertical rename(1.hybrid_week_from_opening_7_5_2 = 1.trad_week_from_opening_7_5_2 2.hybrid_week_from_opening_7_5_2 = 2.trad_week_from_opening_7_5_2 3.hybrid_week_from_opening_7_5_2 = 3.trad_week_from_opening_7_5_2 4.hybrid_week_from_opening_7_5_2 = 4.trad_week_from_opening_7_5_2 5.hybrid_week_from_opening_7_5_2 = 5.trad_week_from_opening_7_5_2 6.hybrid_week_from_opening_7_5_2 = 6.trad_week_from_opening_7_5_2 7.hybrid_week_from_opening_7_5_2 = 7.trad_week_from_opening_7_5_2 8.hybrid_week_from_opening_7_5_2 = 8.trad_week_from_opening_7_5_2 9.hybrid_week_from_opening_7_5_2 = 9.trad_week_from_opening_7_5_2 10.hybrid_week_from_opening_7_5_2 = 10.trad_week_from_opening_7_5_2 11.hybrid_week_from_opening_7_5_2 = 11.trad_week_from_opening_7_5_2 12.hybrid_week_from_opening_7_5_2 = 12.trad_week_from_opening_7_5_2 13.hybrid_week_from_opening_7_5_2 = 13.trad_week_from_opening_7_5_2 14.hybrid_week_from_opening_7_5_2 = 14.trad_week_from_opening_7_5_2 15.hybrid_week_from_opening_7_5_2 = 15.trad_week_from_opening_7_5_2 16.hybrid_week_from_opening_7_5_2 = 16.trad_week_from_opening_7_5_2 17.hybrid_week_from_opening_7_5_2 = 17.trad_week_from_opening_7_5_2 18.hybrid_week_from_opening_7_5_2 = 18.trad_week_from_opening_7_5_2) coeflabels(1.trad_week_from_opening_7_5_2 = "-4" 2.trad_week_from_opening_7_5_2 = "-3" 3.trad_week_from_opening_7_5_2 = "-2" 4.trad_week_from_opening_7_5_2 = "-1" 5.trad_week_from_opening_7_5_2 = "0" 6.trad_week_from_opening_7_5_2 = "1" 7.trad_week_from_opening_7_5_2 = "2" 8.trad_week_from_opening_7_5_2 = "3" 9.trad_week_from_opening_7_5_2 = "4" 10.trad_week_from_opening_7_5_2 = "5" 11.trad_week_from_opening_7_5_2  = "6" 12.trad_week_from_opening_7_5_2 = "7" 13.trad_week_from_opening_7_5_2 = "8" 14.trad_week_from_opening_7_5_2 = "9" 15.trad_week_from_opening_7_5_2 = "10" 16.trad_week_from_opening_7_5_2 = "11" 17.trad_week_from_opening_7_5_2 = "12" 18.trad_week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)


graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Cases - MW - 20+ - 210615.gph"
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Cases - MW - 20+ - 210615.jpg", as(jpg) name("Graph") quality(100) replace


*S
poisson cases_per_pop_20_100K i.open1_mean_cat_all i.week_from_opening_7_5_2 i.hybrid_week_from_opening_7_5_2 i.trad_week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if region == 3 & week_from_opening_7_5_2 < 18,  vce(robust)

margins, dydx(hybrid_week_from_opening_7_5_2) post

estimates store hybrid_S_20

poisson cases_per_pop_20_100K i.open1_mean_cat_all i.week_from_opening_7_5_2 i.hybrid_week_from_opening_7_5_2 i.trad_week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if region == 3 & week_from_opening_7_5_2 < 18,  vce(robust)

margins, dydx(trad_week_from_opening_7_5_2) post

estimates store trad_S_20

*plotting the coefficients
coefplot (hybrid_S_20, label(Hybrid) mlcolor(black) mcolor(gs12) ciopts(recast(rcap) color(gs10)))   (trad_S_20, label(Traditional) mlcolor(black) mcolor(gs2) ciopts(recast(rcap) color(gs2))), yline(0, lcolor(black) lpattern(dash)) vertical rename(1.hybrid_week_from_opening_7_5_2 = 1.trad_week_from_opening_7_5_2 2.hybrid_week_from_opening_7_5_2 = 2.trad_week_from_opening_7_5_2 3.hybrid_week_from_opening_7_5_2 = 3.trad_week_from_opening_7_5_2 4.hybrid_week_from_opening_7_5_2 = 4.trad_week_from_opening_7_5_2 5.hybrid_week_from_opening_7_5_2 = 5.trad_week_from_opening_7_5_2 6.hybrid_week_from_opening_7_5_2 = 6.trad_week_from_opening_7_5_2 7.hybrid_week_from_opening_7_5_2 = 7.trad_week_from_opening_7_5_2 8.hybrid_week_from_opening_7_5_2 = 8.trad_week_from_opening_7_5_2 9.hybrid_week_from_opening_7_5_2 = 9.trad_week_from_opening_7_5_2 10.hybrid_week_from_opening_7_5_2 = 10.trad_week_from_opening_7_5_2 11.hybrid_week_from_opening_7_5_2 = 11.trad_week_from_opening_7_5_2 12.hybrid_week_from_opening_7_5_2 = 12.trad_week_from_opening_7_5_2 13.hybrid_week_from_opening_7_5_2 = 13.trad_week_from_opening_7_5_2 14.hybrid_week_from_opening_7_5_2 = 14.trad_week_from_opening_7_5_2 15.hybrid_week_from_opening_7_5_2 = 15.trad_week_from_opening_7_5_2 16.hybrid_week_from_opening_7_5_2 = 16.trad_week_from_opening_7_5_2 17.hybrid_week_from_opening_7_5_2 = 17.trad_week_from_opening_7_5_2 18.hybrid_week_from_opening_7_5_2 = 18.trad_week_from_opening_7_5_2) coeflabels(1.trad_week_from_opening_7_5_2 = "-4" 2.trad_week_from_opening_7_5_2 = "-3" 3.trad_week_from_opening_7_5_2 = "-2" 4.trad_week_from_opening_7_5_2 = "-1" 5.trad_week_from_opening_7_5_2 = "0" 6.trad_week_from_opening_7_5_2 = "1" 7.trad_week_from_opening_7_5_2 = "2" 8.trad_week_from_opening_7_5_2 = "3" 9.trad_week_from_opening_7_5_2 = "4" 10.trad_week_from_opening_7_5_2 = "5" 11.trad_week_from_opening_7_5_2  = "6" 12.trad_week_from_opening_7_5_2 = "7" 13.trad_week_from_opening_7_5_2 = "8" 14.trad_week_from_opening_7_5_2 = "9" 15.trad_week_from_opening_7_5_2 = "10" 16.trad_week_from_opening_7_5_2 = "11" 17.trad_week_from_opening_7_5_2 = "12" 18.trad_week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)


graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Cases - S - 20+ - 210615.gph"
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Cases - S - 20+ - 210615.jpg", as(jpg) name("Graph") quality(100) replace







***DEATHS
**all ages
*NE (I took out the facial coverings variable so that it wouldn't be concave)
poisson deaths_per_pop_100K i.open1_mean_cat_all i.week_from_opening_7_5_2 i.hybrid_week_from_opening_7_5_2 i.trad_week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat   i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if region == 0 & week_from_opening_7_5_2 < 18,  vce(robust)

margins, dydx(hybrid_week_from_opening_7_5_2) post

estimates store hybrid_NE_all_deaths


poisson deaths_per_pop_100K i.open1_mean_cat_all i.week_from_opening_7_5_2 i.hybrid_week_from_opening_7_5_2 i.trad_week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat   i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if region == 0 & week_from_opening_7_5_2 < 18,  vce(robust)

margins, dydx(trad_week_from_opening_7_5_2) post

estimates store trad_NE_all_deaths

*plotting the coefficients
coefplot (hybrid_NE_all_deaths, label(Hybrid) mlcolor(black) mcolor(gs12) ciopts(recast(rcap) color(gs10)))   (trad_NE_all_deaths, label(Traditional) mlcolor(black) mcolor(gs2) ciopts(recast(rcap) color(gs2))), yline(0, lcolor(black) lpattern(dash)) vertical rename(1.hybrid_week_from_opening_7_5_2 = 1.trad_week_from_opening_7_5_2 2.hybrid_week_from_opening_7_5_2 = 2.trad_week_from_opening_7_5_2 3.hybrid_week_from_opening_7_5_2 = 3.trad_week_from_opening_7_5_2 4.hybrid_week_from_opening_7_5_2 = 4.trad_week_from_opening_7_5_2 5.hybrid_week_from_opening_7_5_2 = 5.trad_week_from_opening_7_5_2 6.hybrid_week_from_opening_7_5_2 = 6.trad_week_from_opening_7_5_2 7.hybrid_week_from_opening_7_5_2 = 7.trad_week_from_opening_7_5_2 8.hybrid_week_from_opening_7_5_2 = 8.trad_week_from_opening_7_5_2 9.hybrid_week_from_opening_7_5_2 = 9.trad_week_from_opening_7_5_2 10.hybrid_week_from_opening_7_5_2 = 10.trad_week_from_opening_7_5_2 11.hybrid_week_from_opening_7_5_2 = 11.trad_week_from_opening_7_5_2 12.hybrid_week_from_opening_7_5_2 = 12.trad_week_from_opening_7_5_2 13.hybrid_week_from_opening_7_5_2 = 13.trad_week_from_opening_7_5_2 14.hybrid_week_from_opening_7_5_2 = 14.trad_week_from_opening_7_5_2 15.hybrid_week_from_opening_7_5_2 = 15.trad_week_from_opening_7_5_2 16.hybrid_week_from_opening_7_5_2 = 16.trad_week_from_opening_7_5_2 17.hybrid_week_from_opening_7_5_2 = 17.trad_week_from_opening_7_5_2 18.hybrid_week_from_opening_7_5_2 = 18.trad_week_from_opening_7_5_2) coeflabels(1.trad_week_from_opening_7_5_2 = "-4" 2.trad_week_from_opening_7_5_2 = "-3" 3.trad_week_from_opening_7_5_2 = "-2" 4.trad_week_from_opening_7_5_2 = "-1" 5.trad_week_from_opening_7_5_2 = "0" 6.trad_week_from_opening_7_5_2 = "1" 7.trad_week_from_opening_7_5_2 = "2" 8.trad_week_from_opening_7_5_2 = "3" 9.trad_week_from_opening_7_5_2 = "4" 10.trad_week_from_opening_7_5_2 = "5" 11.trad_week_from_opening_7_5_2  = "6" 12.trad_week_from_opening_7_5_2 = "7" 13.trad_week_from_opening_7_5_2 = "8" 14.trad_week_from_opening_7_5_2 = "9" 15.trad_week_from_opening_7_5_2 = "10" 16.trad_week_from_opening_7_5_2 = "11" 17.trad_week_from_opening_7_5_2 = "12" 18.trad_week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)


graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Deaths - NE - All Ages - 210616.gph", replace
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Deaths - NE - All Ages - 210616.jpg", as(jpg) name("Graph") quality(100) replace




*Pacific (I took out the facial coverings variable so it would run properly)
reg deaths_per_pop_100K i.open1_mean_cat_all i.week_from_opening_7_5_2 i.hybrid_week_from_opening_7_5_2 i.trad_week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat   i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if division == 2 & week_from_opening_7_5_2 < 18,  vce(robust)

margins, dydx(hybrid_week_from_opening_7_5_2) post

estimates store hybrid_W_P_all_deaths

reg deaths_per_pop_100K i.open1_mean_cat_all i.week_from_opening_7_5_2 i.hybrid_week_from_opening_7_5_2 i.trad_week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat   i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if division == 2 & week_from_opening_7_5_2 < 18,  vce(robust)

margins, dydx(trad_week_from_opening_7_5_2) post

estimates store trad_W_P_all_deaths


*plotting the coefficients
coefplot (hybrid_W_P_all_deaths, label(Hybrid) mlcolor(black) mcolor(gs12) ciopts(recast(rcap) color(gs10)))   (trad_W_P_all_deaths, label(Traditional) mlcolor(black) mcolor(gs2) ciopts(recast(rcap) color(gs2))), yline(0, lcolor(black) lpattern(dash)) vertical rename(1.hybrid_week_from_opening_7_5_2 = 1.trad_week_from_opening_7_5_2 2.hybrid_week_from_opening_7_5_2 = 2.trad_week_from_opening_7_5_2 3.hybrid_week_from_opening_7_5_2 = 3.trad_week_from_opening_7_5_2 4.hybrid_week_from_opening_7_5_2 = 4.trad_week_from_opening_7_5_2 5.hybrid_week_from_opening_7_5_2 = 5.trad_week_from_opening_7_5_2 6.hybrid_week_from_opening_7_5_2 = 6.trad_week_from_opening_7_5_2 7.hybrid_week_from_opening_7_5_2 = 7.trad_week_from_opening_7_5_2 8.hybrid_week_from_opening_7_5_2 = 8.trad_week_from_opening_7_5_2 9.hybrid_week_from_opening_7_5_2 = 9.trad_week_from_opening_7_5_2 10.hybrid_week_from_opening_7_5_2 = 10.trad_week_from_opening_7_5_2 11.hybrid_week_from_opening_7_5_2 = 11.trad_week_from_opening_7_5_2 12.hybrid_week_from_opening_7_5_2 = 12.trad_week_from_opening_7_5_2 13.hybrid_week_from_opening_7_5_2 = 13.trad_week_from_opening_7_5_2 14.hybrid_week_from_opening_7_5_2 = 14.trad_week_from_opening_7_5_2 15.hybrid_week_from_opening_7_5_2 = 15.trad_week_from_opening_7_5_2 16.hybrid_week_from_opening_7_5_2 = 16.trad_week_from_opening_7_5_2 17.hybrid_week_from_opening_7_5_2 = 17.trad_week_from_opening_7_5_2 18.hybrid_week_from_opening_7_5_2 = 18.trad_week_from_opening_7_5_2) coeflabels(1.trad_week_from_opening_7_5_2 = "-4" 2.trad_week_from_opening_7_5_2 = "-3" 3.trad_week_from_opening_7_5_2 = "-2" 4.trad_week_from_opening_7_5_2 = "-1" 5.trad_week_from_opening_7_5_2 = "0" 6.trad_week_from_opening_7_5_2 = "1" 7.trad_week_from_opening_7_5_2 = "2" 8.trad_week_from_opening_7_5_2 = "3" 9.trad_week_from_opening_7_5_2 = "4" 10.trad_week_from_opening_7_5_2 = "5" 11.trad_week_from_opening_7_5_2  = "6" 12.trad_week_from_opening_7_5_2 = "7" 13.trad_week_from_opening_7_5_2 = "8" 14.trad_week_from_opening_7_5_2 = "9" 15.trad_week_from_opening_7_5_2 = "10" 16.trad_week_from_opening_7_5_2 = "11" 17.trad_week_from_opening_7_5_2 = "12" 18.trad_week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)


graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Deaths - W Pacific - All Ages - 210616.gph", replace
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Deaths - W Pacific - All Ages - 210616.jpg", as(jpg) name("Graph") quality(100) replace



*Mountain
poisson deaths_per_pop_100K i.open1_mean_cat_all i.week_from_opening_7_5_2 i.hybrid_week_from_opening_7_5_2 i.trad_week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if division == 3 & week_from_opening_7_5_2 < 18,  vce(robust)

margins, dydx(hybrid_week_from_opening_7_5_2) post

estimates store hybrid_W_M_all_deaths

poisson deaths_per_pop_100K i.open1_mean_cat_all i.week_from_opening_7_5_2 i.hybrid_week_from_opening_7_5_2 i.trad_week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if division == 3 & week_from_opening_7_5_2 < 18,  vce(robust)

margins, dydx(trad_week_from_opening_7_5_2) post

estimates store trad_W_M_all_deaths


*plotting the coefficients
coefplot (hybrid_W_M_all_deaths, label(Hybrid) mlcolor(black) mcolor(gs12) ciopts(recast(rcap) color(gs10)))   (trad_W_M_all_deaths, label(Traditional) mlcolor(black) mcolor(gs2) ciopts(recast(rcap) color(gs2))), yline(0, lcolor(black) lpattern(dash)) vertical rename(1.hybrid_week_from_opening_7_5_2 = 1.trad_week_from_opening_7_5_2 2.hybrid_week_from_opening_7_5_2 = 2.trad_week_from_opening_7_5_2 3.hybrid_week_from_opening_7_5_2 = 3.trad_week_from_opening_7_5_2 4.hybrid_week_from_opening_7_5_2 = 4.trad_week_from_opening_7_5_2 5.hybrid_week_from_opening_7_5_2 = 5.trad_week_from_opening_7_5_2 6.hybrid_week_from_opening_7_5_2 = 6.trad_week_from_opening_7_5_2 7.hybrid_week_from_opening_7_5_2 = 7.trad_week_from_opening_7_5_2 8.hybrid_week_from_opening_7_5_2 = 8.trad_week_from_opening_7_5_2 9.hybrid_week_from_opening_7_5_2 = 9.trad_week_from_opening_7_5_2 10.hybrid_week_from_opening_7_5_2 = 10.trad_week_from_opening_7_5_2 11.hybrid_week_from_opening_7_5_2 = 11.trad_week_from_opening_7_5_2 12.hybrid_week_from_opening_7_5_2 = 12.trad_week_from_opening_7_5_2 13.hybrid_week_from_opening_7_5_2 = 13.trad_week_from_opening_7_5_2 14.hybrid_week_from_opening_7_5_2 = 14.trad_week_from_opening_7_5_2 15.hybrid_week_from_opening_7_5_2 = 15.trad_week_from_opening_7_5_2 16.hybrid_week_from_opening_7_5_2 = 16.trad_week_from_opening_7_5_2 17.hybrid_week_from_opening_7_5_2 = 17.trad_week_from_opening_7_5_2 18.hybrid_week_from_opening_7_5_2 = 18.trad_week_from_opening_7_5_2) coeflabels(1.trad_week_from_opening_7_5_2 = "-4" 2.trad_week_from_opening_7_5_2 = "-3" 3.trad_week_from_opening_7_5_2 = "-2" 4.trad_week_from_opening_7_5_2 = "-1" 5.trad_week_from_opening_7_5_2 = "0" 6.trad_week_from_opening_7_5_2 = "1" 7.trad_week_from_opening_7_5_2 = "2" 8.trad_week_from_opening_7_5_2 = "3" 9.trad_week_from_opening_7_5_2 = "4" 10.trad_week_from_opening_7_5_2 = "5" 11.trad_week_from_opening_7_5_2  = "6" 12.trad_week_from_opening_7_5_2 = "7" 13.trad_week_from_opening_7_5_2 = "8" 14.trad_week_from_opening_7_5_2 = "9" 15.trad_week_from_opening_7_5_2 = "10" 16.trad_week_from_opening_7_5_2 = "11" 17.trad_week_from_opening_7_5_2 = "12" 18.trad_week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)


graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Deaths - W Mountain - All Ages - 210616.gph"
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Deaths - W Mountain - All Ages - 210616.jpg", as(jpg) name("Graph") quality(100) replace


*MW
poisson deaths_per_pop_100K i.open1_mean_cat_all i.week_from_opening_7_5_2 i.hybrid_week_from_opening_7_5_2 i.trad_week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if region == 2 & week_from_opening_7_5_2 < 18,  vce(robust)

margins, dydx(hybrid_week_from_opening_7_5_2)  post

estimates store hybrid_MW_all_deaths

poisson deaths_per_pop_100K i.open1_mean_cat_all i.week_from_opening_7_5_2 i.hybrid_week_from_opening_7_5_2 i.trad_week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if region == 2 & week_from_opening_7_5_2 < 18,  vce(robust)

margins, dydx(trad_week_from_opening_7_5_2)  post

estimates store trad_MW_all_deaths

*plotting the coefficients
coefplot (hybrid_MW_all_deaths, label(Hybrid) mlcolor(black) mcolor(gs12) ciopts(recast(rcap) color(gs10)))   (trad_MW_all_deaths, label(Traditional) mlcolor(black) mcolor(gs2) ciopts(recast(rcap) color(gs2))), yline(0, lcolor(black) lpattern(dash)) vertical rename(1.hybrid_week_from_opening_7_5_2 = 1.trad_week_from_opening_7_5_2 2.hybrid_week_from_opening_7_5_2 = 2.trad_week_from_opening_7_5_2 3.hybrid_week_from_opening_7_5_2 = 3.trad_week_from_opening_7_5_2 4.hybrid_week_from_opening_7_5_2 = 4.trad_week_from_opening_7_5_2 5.hybrid_week_from_opening_7_5_2 = 5.trad_week_from_opening_7_5_2 6.hybrid_week_from_opening_7_5_2 = 6.trad_week_from_opening_7_5_2 7.hybrid_week_from_opening_7_5_2 = 7.trad_week_from_opening_7_5_2 8.hybrid_week_from_opening_7_5_2 = 8.trad_week_from_opening_7_5_2 9.hybrid_week_from_opening_7_5_2 = 9.trad_week_from_opening_7_5_2 10.hybrid_week_from_opening_7_5_2 = 10.trad_week_from_opening_7_5_2 11.hybrid_week_from_opening_7_5_2 = 11.trad_week_from_opening_7_5_2 12.hybrid_week_from_opening_7_5_2 = 12.trad_week_from_opening_7_5_2 13.hybrid_week_from_opening_7_5_2 = 13.trad_week_from_opening_7_5_2 14.hybrid_week_from_opening_7_5_2 = 14.trad_week_from_opening_7_5_2 15.hybrid_week_from_opening_7_5_2 = 15.trad_week_from_opening_7_5_2 16.hybrid_week_from_opening_7_5_2 = 16.trad_week_from_opening_7_5_2 17.hybrid_week_from_opening_7_5_2 = 17.trad_week_from_opening_7_5_2 18.hybrid_week_from_opening_7_5_2 = 18.trad_week_from_opening_7_5_2) coeflabels(1.trad_week_from_opening_7_5_2 = "-4" 2.trad_week_from_opening_7_5_2 = "-3" 3.trad_week_from_opening_7_5_2 = "-2" 4.trad_week_from_opening_7_5_2 = "-1" 5.trad_week_from_opening_7_5_2 = "0" 6.trad_week_from_opening_7_5_2 = "1" 7.trad_week_from_opening_7_5_2 = "2" 8.trad_week_from_opening_7_5_2 = "3" 9.trad_week_from_opening_7_5_2 = "4" 10.trad_week_from_opening_7_5_2 = "5" 11.trad_week_from_opening_7_5_2  = "6" 12.trad_week_from_opening_7_5_2 = "7" 13.trad_week_from_opening_7_5_2 = "8" 14.trad_week_from_opening_7_5_2 = "9" 15.trad_week_from_opening_7_5_2 = "10" 16.trad_week_from_opening_7_5_2 = "11" 17.trad_week_from_opening_7_5_2 = "12" 18.trad_week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)


graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Deaths - MW - All Ages - 210616.gph"
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Deaths - MW - All Ages - 210616.jpg", as(jpg) name("Graph") quality(100) replace


*S
poisson deaths_per_pop_100K i.open1_mean_cat_all i.week_from_opening_7_5_2 i.hybrid_week_from_opening_7_5_2 i.trad_week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if region == 3 & week_from_opening_7_5_2 < 18,  vce(robust)

margins, dydx(hybrid_week_from_opening_7_5_2) post

estimates store hybrid_S_all_deaths

poisson deaths_per_pop_100K i.open1_mean_cat_all i.week_from_opening_7_5_2 i.hybrid_week_from_opening_7_5_2 i.trad_week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if region == 3 & week_from_opening_7_5_2 < 18,  vce(robust)

margins, dydx(trad_week_from_opening_7_5_2) post

estimates store trad_S_all_deaths

*plotting the coefficients
coefplot (hybrid_S_all_deaths, label(Hybrid) mlcolor(black) mcolor(gs12) ciopts(recast(rcap) color(gs10)))   (trad_S_all_deaths, label(Traditional) mlcolor(black) mcolor(gs2) ciopts(recast(rcap) color(gs2))), yline(0, lcolor(black) lpattern(dash)) vertical rename(1.hybrid_week_from_opening_7_5_2 = 1.trad_week_from_opening_7_5_2 2.hybrid_week_from_opening_7_5_2 = 2.trad_week_from_opening_7_5_2 3.hybrid_week_from_opening_7_5_2 = 3.trad_week_from_opening_7_5_2 4.hybrid_week_from_opening_7_5_2 = 4.trad_week_from_opening_7_5_2 5.hybrid_week_from_opening_7_5_2 = 5.trad_week_from_opening_7_5_2 6.hybrid_week_from_opening_7_5_2 = 6.trad_week_from_opening_7_5_2 7.hybrid_week_from_opening_7_5_2 = 7.trad_week_from_opening_7_5_2 8.hybrid_week_from_opening_7_5_2 = 8.trad_week_from_opening_7_5_2 9.hybrid_week_from_opening_7_5_2 = 9.trad_week_from_opening_7_5_2 10.hybrid_week_from_opening_7_5_2 = 10.trad_week_from_opening_7_5_2 11.hybrid_week_from_opening_7_5_2 = 11.trad_week_from_opening_7_5_2 12.hybrid_week_from_opening_7_5_2 = 12.trad_week_from_opening_7_5_2 13.hybrid_week_from_opening_7_5_2 = 13.trad_week_from_opening_7_5_2 14.hybrid_week_from_opening_7_5_2 = 14.trad_week_from_opening_7_5_2 15.hybrid_week_from_opening_7_5_2 = 15.trad_week_from_opening_7_5_2 16.hybrid_week_from_opening_7_5_2 = 16.trad_week_from_opening_7_5_2 17.hybrid_week_from_opening_7_5_2 = 17.trad_week_from_opening_7_5_2 18.hybrid_week_from_opening_7_5_2 = 18.trad_week_from_opening_7_5_2) coeflabels(1.trad_week_from_opening_7_5_2 = "-4" 2.trad_week_from_opening_7_5_2 = "-3" 3.trad_week_from_opening_7_5_2 = "-2" 4.trad_week_from_opening_7_5_2 = "-1" 5.trad_week_from_opening_7_5_2 = "0" 6.trad_week_from_opening_7_5_2 = "1" 7.trad_week_from_opening_7_5_2 = "2" 8.trad_week_from_opening_7_5_2 = "3" 9.trad_week_from_opening_7_5_2 = "4" 10.trad_week_from_opening_7_5_2 = "5" 11.trad_week_from_opening_7_5_2  = "6" 12.trad_week_from_opening_7_5_2 = "7" 13.trad_week_from_opening_7_5_2 = "8" 14.trad_week_from_opening_7_5_2 = "9" 15.trad_week_from_opening_7_5_2 = "10" 16.trad_week_from_opening_7_5_2 = "11" 17.trad_week_from_opening_7_5_2 = "12" 18.trad_week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)


graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Deaths - S - All Ages - 210616.gph"
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Deaths - S - All Ages - 210616.jpg", as(jpg) name("Graph") quality(100) replace








****by census division
***with state-week FEs
**log OLS
**NE
*New England (I had to take out the Google mobility data in order for the margins command to run)
poisson cases_per_pop_100K i.open1_mean_cat_all i.week_from_opening_7_5_2 i.hybrid_week_from_opening_7_5_2 i.trad_week_from_opening_7_5_2   i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if division == 0 & week_from_opening_7_5_2 < 18,  vce(robust)

margins, dydx(hybrid_week_from_opening_7_5_2) post

estimates store hybrid_NE_NE_all

poisson cases_per_pop_100K i.open1_mean_cat_all i.week_from_opening_7_5_2 i.hybrid_week_from_opening_7_5_2 i.trad_week_from_opening_7_5_2  i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if division == 0 & week_from_opening_7_5_2 < 18,  vce(robust)

margins, dydx(trad_week_from_opening_7_5_2) post

estimates store trad_NE_NE_all


*plotting the coefficients
coefplot (hybrid_NE_NE_all, label(Hybrid) mlcolor(black) mcolor(gs12) ciopts(recast(rcap) color(gs10)))   (trad_NE_NE_all, label(Traditional) mlcolor(black) mcolor(gs2) ciopts(recast(rcap) color(gs2))), yline(0, lcolor(black) lpattern(dash)) vertical rename(1.hybrid_week_from_opening_7_5_2 = 1.trad_week_from_opening_7_5_2 2.hybrid_week_from_opening_7_5_2 = 2.trad_week_from_opening_7_5_2 3.hybrid_week_from_opening_7_5_2 = 3.trad_week_from_opening_7_5_2 4.hybrid_week_from_opening_7_5_2 = 4.trad_week_from_opening_7_5_2 5.hybrid_week_from_opening_7_5_2 = 5.trad_week_from_opening_7_5_2 6.hybrid_week_from_opening_7_5_2 = 6.trad_week_from_opening_7_5_2 7.hybrid_week_from_opening_7_5_2 = 7.trad_week_from_opening_7_5_2 8.hybrid_week_from_opening_7_5_2 = 8.trad_week_from_opening_7_5_2 9.hybrid_week_from_opening_7_5_2 = 9.trad_week_from_opening_7_5_2 10.hybrid_week_from_opening_7_5_2 = 10.trad_week_from_opening_7_5_2 11.hybrid_week_from_opening_7_5_2 = 11.trad_week_from_opening_7_5_2 12.hybrid_week_from_opening_7_5_2 = 12.trad_week_from_opening_7_5_2 13.hybrid_week_from_opening_7_5_2 = 13.trad_week_from_opening_7_5_2 14.hybrid_week_from_opening_7_5_2 = 14.trad_week_from_opening_7_5_2 15.hybrid_week_from_opening_7_5_2 = 15.trad_week_from_opening_7_5_2 16.hybrid_week_from_opening_7_5_2 = 16.trad_week_from_opening_7_5_2 17.hybrid_week_from_opening_7_5_2 = 17.trad_week_from_opening_7_5_2 18.hybrid_week_from_opening_7_5_2 = 18.trad_week_from_opening_7_5_2) coeflabels(1.trad_week_from_opening_7_5_2 = "-4" 2.trad_week_from_opening_7_5_2 = "-3" 3.trad_week_from_opening_7_5_2 = "-2" 4.trad_week_from_opening_7_5_2 = "-1" 5.trad_week_from_opening_7_5_2 = "0" 6.trad_week_from_opening_7_5_2 = "1" 7.trad_week_from_opening_7_5_2 = "2" 8.trad_week_from_opening_7_5_2 = "3" 9.trad_week_from_opening_7_5_2 = "4" 10.trad_week_from_opening_7_5_2 = "5" 11.trad_week_from_opening_7_5_2  = "6" 12.trad_week_from_opening_7_5_2 = "7" 13.trad_week_from_opening_7_5_2 = "8" 14.trad_week_from_opening_7_5_2 = "9" 15.trad_week_from_opening_7_5_2 = "10" 16.trad_week_from_opening_7_5_2 = "11" 17.trad_week_from_opening_7_5_2 = "12" 18.trad_week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)


graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Cases - NE New England - All Ages - 210601.gph", replace
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Cases - NE New England - All Ages - 210601.jpg", as(jpg) name("Graph") quality(100) replace


*Middle Atlantic
poisson cases_per_pop_100K i.open1_mean_cat_all i.week_from_opening_7_5_2 i.hybrid_week_from_opening_7_5_2 i.trad_week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if division == 1 & week_from_opening_7_5_2 < 18,  vce(robust)

margins, dydx(hybrid_week_from_opening_7_5_2) post

estimates store hybrid_NE_MA_all

poisson cases_per_pop_100K i.open1_mean_cat_all i.week_from_opening_7_5_2 i.hybrid_week_from_opening_7_5_2 i.trad_week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if division == 1 & week_from_opening_7_5_2 < 18,  vce(robust)

margins, dydx(trad_week_from_opening_7_5_2) post

estimates store trad_NE_MA_all


*plotting the coefficients
coefplot (hybrid_NE_MA_all, label(Hybrid) mlcolor(black) mcolor(gs12) ciopts(recast(rcap) color(gs10)))   (trad_NE_MA_all, label(Traditional) mlcolor(black) mcolor(gs2) ciopts(recast(rcap) color(gs2))), yline(0, lcolor(black) lpattern(dash)) vertical rename(1.hybrid_week_from_opening_7_5_2 = 1.trad_week_from_opening_7_5_2 2.hybrid_week_from_opening_7_5_2 = 2.trad_week_from_opening_7_5_2 3.hybrid_week_from_opening_7_5_2 = 3.trad_week_from_opening_7_5_2 4.hybrid_week_from_opening_7_5_2 = 4.trad_week_from_opening_7_5_2 5.hybrid_week_from_opening_7_5_2 = 5.trad_week_from_opening_7_5_2 6.hybrid_week_from_opening_7_5_2 = 6.trad_week_from_opening_7_5_2 7.hybrid_week_from_opening_7_5_2 = 7.trad_week_from_opening_7_5_2 8.hybrid_week_from_opening_7_5_2 = 8.trad_week_from_opening_7_5_2 9.hybrid_week_from_opening_7_5_2 = 9.trad_week_from_opening_7_5_2 10.hybrid_week_from_opening_7_5_2 = 10.trad_week_from_opening_7_5_2 11.hybrid_week_from_opening_7_5_2 = 11.trad_week_from_opening_7_5_2 12.hybrid_week_from_opening_7_5_2 = 12.trad_week_from_opening_7_5_2 13.hybrid_week_from_opening_7_5_2 = 13.trad_week_from_opening_7_5_2 14.hybrid_week_from_opening_7_5_2 = 14.trad_week_from_opening_7_5_2 15.hybrid_week_from_opening_7_5_2 = 15.trad_week_from_opening_7_5_2 16.hybrid_week_from_opening_7_5_2 = 16.trad_week_from_opening_7_5_2 17.hybrid_week_from_opening_7_5_2 = 17.trad_week_from_opening_7_5_2 18.hybrid_week_from_opening_7_5_2 = 18.trad_week_from_opening_7_5_2) coeflabels(1.trad_week_from_opening_7_5_2 = "-4" 2.trad_week_from_opening_7_5_2 = "-3" 3.trad_week_from_opening_7_5_2 = "-2" 4.trad_week_from_opening_7_5_2 = "-1" 5.trad_week_from_opening_7_5_2 = "0" 6.trad_week_from_opening_7_5_2 = "1" 7.trad_week_from_opening_7_5_2 = "2" 8.trad_week_from_opening_7_5_2 = "3" 9.trad_week_from_opening_7_5_2 = "4" 10.trad_week_from_opening_7_5_2 = "5" 11.trad_week_from_opening_7_5_2  = "6" 12.trad_week_from_opening_7_5_2 = "7" 13.trad_week_from_opening_7_5_2 = "8" 14.trad_week_from_opening_7_5_2 = "9" 15.trad_week_from_opening_7_5_2 = "10" 16.trad_week_from_opening_7_5_2 = "11" 17.trad_week_from_opening_7_5_2 = "12" 18.trad_week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)


graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Cases - NE Middle Atlantic - All Ages - 210601.gph", replace
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Cases - NE Middle Atlantic - All Ages - 210601.jpg", as(jpg) name("Graph") quality(100) replace





*Pacific
poisson cases_per_pop_100K i.open1_mean_cat_all i.week_from_opening_7_5_2 i.hybrid_week_from_opening_7_5_2 i.trad_week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if division == 2 & week_from_opening_7_5_2 < 18,  vce(robust)

margins, dydx(hybrid_week_from_opening_7_5_2) post

estimates store hybrid_W_P_all

poisson cases_per_pop_100K i.open1_mean_cat_all i.week_from_opening_7_5_2 i.hybrid_week_from_opening_7_5_2 i.trad_week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if division == 2 & week_from_opening_7_5_2 < 18,  vce(robust)

margins, dydx(trad_week_from_opening_7_5_2) post

estimates store trad_W_P_all


*plotting the coefficients
coefplot (hybrid_W_P_all, label(Hybrid) mlcolor(black) mcolor(gs12) ciopts(recast(rcap) color(gs10)))   (trad_W_P_all, label(Traditional) mlcolor(black) mcolor(gs2) ciopts(recast(rcap) color(gs2))), yline(0, lcolor(black) lpattern(dash)) vertical rename(1.hybrid_week_from_opening_7_5_2 = 1.trad_week_from_opening_7_5_2 2.hybrid_week_from_opening_7_5_2 = 2.trad_week_from_opening_7_5_2 3.hybrid_week_from_opening_7_5_2 = 3.trad_week_from_opening_7_5_2 4.hybrid_week_from_opening_7_5_2 = 4.trad_week_from_opening_7_5_2 5.hybrid_week_from_opening_7_5_2 = 5.trad_week_from_opening_7_5_2 6.hybrid_week_from_opening_7_5_2 = 6.trad_week_from_opening_7_5_2 7.hybrid_week_from_opening_7_5_2 = 7.trad_week_from_opening_7_5_2 8.hybrid_week_from_opening_7_5_2 = 8.trad_week_from_opening_7_5_2 9.hybrid_week_from_opening_7_5_2 = 9.trad_week_from_opening_7_5_2 10.hybrid_week_from_opening_7_5_2 = 10.trad_week_from_opening_7_5_2 11.hybrid_week_from_opening_7_5_2 = 11.trad_week_from_opening_7_5_2 12.hybrid_week_from_opening_7_5_2 = 12.trad_week_from_opening_7_5_2 13.hybrid_week_from_opening_7_5_2 = 13.trad_week_from_opening_7_5_2 14.hybrid_week_from_opening_7_5_2 = 14.trad_week_from_opening_7_5_2 15.hybrid_week_from_opening_7_5_2 = 15.trad_week_from_opening_7_5_2 16.hybrid_week_from_opening_7_5_2 = 16.trad_week_from_opening_7_5_2 17.hybrid_week_from_opening_7_5_2 = 17.trad_week_from_opening_7_5_2 18.hybrid_week_from_opening_7_5_2 = 18.trad_week_from_opening_7_5_2) coeflabels(1.trad_week_from_opening_7_5_2 = "-4" 2.trad_week_from_opening_7_5_2 = "-3" 3.trad_week_from_opening_7_5_2 = "-2" 4.trad_week_from_opening_7_5_2 = "-1" 5.trad_week_from_opening_7_5_2 = "0" 6.trad_week_from_opening_7_5_2 = "1" 7.trad_week_from_opening_7_5_2 = "2" 8.trad_week_from_opening_7_5_2 = "3" 9.trad_week_from_opening_7_5_2 = "4" 10.trad_week_from_opening_7_5_2 = "5" 11.trad_week_from_opening_7_5_2  = "6" 12.trad_week_from_opening_7_5_2 = "7" 13.trad_week_from_opening_7_5_2 = "8" 14.trad_week_from_opening_7_5_2 = "9" 15.trad_week_from_opening_7_5_2 = "10" 16.trad_week_from_opening_7_5_2 = "11" 17.trad_week_from_opening_7_5_2 = "12" 18.trad_week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)


graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Cases - W Pacific - All Ages - 210601.gph"
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Cases - W Pacific - All Ages - 210601.jpg", as(jpg) name("Graph") quality(100) replace



*Mountain
poisson cases_per_pop_100K i.open1_mean_cat_all i.week_from_opening_7_5_2 i.hybrid_week_from_opening_7_5_2 i.trad_week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if division == 3 & week_from_opening_7_5_2 < 18,  vce(robust)

margins, dydx(hybrid_week_from_opening_7_5_2) post

estimates store hybrid_W_M_all

poisson cases_per_pop_100K i.open1_mean_cat_all i.week_from_opening_7_5_2 i.hybrid_week_from_opening_7_5_2 i.trad_week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if division == 3 & week_from_opening_7_5_2 < 18,  vce(robust)

margins, dydx(trad_week_from_opening_7_5_2) post

estimates store trad_W_M_all


*plotting the coefficients
coefplot (hybrid_W_M_all, label(Hybrid) mlcolor(black) mcolor(gs12) ciopts(recast(rcap) color(gs10)))   (trad_W_M_all, label(Traditional) mlcolor(black) mcolor(gs2) ciopts(recast(rcap) color(gs2))), yline(0, lcolor(black) lpattern(dash)) vertical rename(1.hybrid_week_from_opening_7_5_2 = 1.trad_week_from_opening_7_5_2 2.hybrid_week_from_opening_7_5_2 = 2.trad_week_from_opening_7_5_2 3.hybrid_week_from_opening_7_5_2 = 3.trad_week_from_opening_7_5_2 4.hybrid_week_from_opening_7_5_2 = 4.trad_week_from_opening_7_5_2 5.hybrid_week_from_opening_7_5_2 = 5.trad_week_from_opening_7_5_2 6.hybrid_week_from_opening_7_5_2 = 6.trad_week_from_opening_7_5_2 7.hybrid_week_from_opening_7_5_2 = 7.trad_week_from_opening_7_5_2 8.hybrid_week_from_opening_7_5_2 = 8.trad_week_from_opening_7_5_2 9.hybrid_week_from_opening_7_5_2 = 9.trad_week_from_opening_7_5_2 10.hybrid_week_from_opening_7_5_2 = 10.trad_week_from_opening_7_5_2 11.hybrid_week_from_opening_7_5_2 = 11.trad_week_from_opening_7_5_2 12.hybrid_week_from_opening_7_5_2 = 12.trad_week_from_opening_7_5_2 13.hybrid_week_from_opening_7_5_2 = 13.trad_week_from_opening_7_5_2 14.hybrid_week_from_opening_7_5_2 = 14.trad_week_from_opening_7_5_2 15.hybrid_week_from_opening_7_5_2 = 15.trad_week_from_opening_7_5_2 16.hybrid_week_from_opening_7_5_2 = 16.trad_week_from_opening_7_5_2 17.hybrid_week_from_opening_7_5_2 = 17.trad_week_from_opening_7_5_2 18.hybrid_week_from_opening_7_5_2 = 18.trad_week_from_opening_7_5_2) coeflabels(1.trad_week_from_opening_7_5_2 = "-4" 2.trad_week_from_opening_7_5_2 = "-3" 3.trad_week_from_opening_7_5_2 = "-2" 4.trad_week_from_opening_7_5_2 = "-1" 5.trad_week_from_opening_7_5_2 = "0" 6.trad_week_from_opening_7_5_2 = "1" 7.trad_week_from_opening_7_5_2 = "2" 8.trad_week_from_opening_7_5_2 = "3" 9.trad_week_from_opening_7_5_2 = "4" 10.trad_week_from_opening_7_5_2 = "5" 11.trad_week_from_opening_7_5_2  = "6" 12.trad_week_from_opening_7_5_2 = "7" 13.trad_week_from_opening_7_5_2 = "8" 14.trad_week_from_opening_7_5_2 = "9" 15.trad_week_from_opening_7_5_2 = "10" 16.trad_week_from_opening_7_5_2 = "11" 17.trad_week_from_opening_7_5_2 = "12" 18.trad_week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)


graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Cases - W Mountain - All Ages - 210601.gph"
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Cases - W Mountain - All Ages - 210601.jpg", as(jpg) name("Graph") quality(100) replace





*East North Central
poisson cases_per_pop_100K i.open1_mean_cat_all i.week_from_opening_7_5_2 i.hybrid_week_from_opening_7_5_2 i.trad_week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if division == 4 & week_from_opening_7_5_2 < 18,  vce(robust)

margins, dydx(hybrid_week_from_opening_7_5_2) post

estimates store hybrid_MW_ENC_all

poisson cases_per_pop_100K i.open1_mean_cat_all i.week_from_opening_7_5_2 i.hybrid_week_from_opening_7_5_2 i.trad_week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if division == 4 & week_from_opening_7_5_2 < 18,  vce(robust)

margins, dydx(trad_week_from_opening_7_5_2) post

estimates store trad_MW_ENC_all


*plotting the coefficients
coefplot (hybrid_MW_ENC_all, label(Hybrid) mlcolor(black) mcolor(gs12) ciopts(recast(rcap) color(gs10)))   (trad_MW_ENC_all, label(Traditional) mlcolor(black) mcolor(gs2) ciopts(recast(rcap) color(gs2))), yline(0, lcolor(black) lpattern(dash)) vertical rename(1.hybrid_week_from_opening_7_5_2 = 1.trad_week_from_opening_7_5_2 2.hybrid_week_from_opening_7_5_2 = 2.trad_week_from_opening_7_5_2 3.hybrid_week_from_opening_7_5_2 = 3.trad_week_from_opening_7_5_2 4.hybrid_week_from_opening_7_5_2 = 4.trad_week_from_opening_7_5_2 5.hybrid_week_from_opening_7_5_2 = 5.trad_week_from_opening_7_5_2 6.hybrid_week_from_opening_7_5_2 = 6.trad_week_from_opening_7_5_2 7.hybrid_week_from_opening_7_5_2 = 7.trad_week_from_opening_7_5_2 8.hybrid_week_from_opening_7_5_2 = 8.trad_week_from_opening_7_5_2 9.hybrid_week_from_opening_7_5_2 = 9.trad_week_from_opening_7_5_2 10.hybrid_week_from_opening_7_5_2 = 10.trad_week_from_opening_7_5_2 11.hybrid_week_from_opening_7_5_2 = 11.trad_week_from_opening_7_5_2 12.hybrid_week_from_opening_7_5_2 = 12.trad_week_from_opening_7_5_2 13.hybrid_week_from_opening_7_5_2 = 13.trad_week_from_opening_7_5_2 14.hybrid_week_from_opening_7_5_2 = 14.trad_week_from_opening_7_5_2 15.hybrid_week_from_opening_7_5_2 = 15.trad_week_from_opening_7_5_2 16.hybrid_week_from_opening_7_5_2 = 16.trad_week_from_opening_7_5_2 17.hybrid_week_from_opening_7_5_2 = 17.trad_week_from_opening_7_5_2 18.hybrid_week_from_opening_7_5_2 = 18.trad_week_from_opening_7_5_2) coeflabels(1.trad_week_from_opening_7_5_2 = "-4" 2.trad_week_from_opening_7_5_2 = "-3" 3.trad_week_from_opening_7_5_2 = "-2" 4.trad_week_from_opening_7_5_2 = "-1" 5.trad_week_from_opening_7_5_2 = "0" 6.trad_week_from_opening_7_5_2 = "1" 7.trad_week_from_opening_7_5_2 = "2" 8.trad_week_from_opening_7_5_2 = "3" 9.trad_week_from_opening_7_5_2 = "4" 10.trad_week_from_opening_7_5_2 = "5" 11.trad_week_from_opening_7_5_2  = "6" 12.trad_week_from_opening_7_5_2 = "7" 13.trad_week_from_opening_7_5_2 = "8" 14.trad_week_from_opening_7_5_2 = "9" 15.trad_week_from_opening_7_5_2 = "10" 16.trad_week_from_opening_7_5_2 = "11" 17.trad_week_from_opening_7_5_2 = "12" 18.trad_week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)


graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Cases - MW East North Central - All Ages - 210601.gph"
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Cases - MW East North Central - All Ages - 210601.jpg", as(jpg) name("Graph") quality(100) replace







*West North Central (I took out the Google mobility data in order for the margins command to run)
poisson cases_per_pop_100K i.open1_mean_cat_all i.week_from_opening_7_5_2 i.hybrid_week_from_opening_7_5_2 i.trad_week_from_opening_7_5_2  i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if division == 5 & week_from_opening_7_5_2 < 18,  vce(robust)

margins, dydx(hybrid_week_from_opening_7_5_2) post

estimates store hybrid_MW_WNC_all

poisson cases_per_pop_100K i.open1_mean_cat_all i.week_from_opening_7_5_2 i.hybrid_week_from_opening_7_5_2 i.trad_week_from_opening_7_5_2  i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if division == 5 & week_from_opening_7_5_2 < 18,  vce(robust)

margins, dydx(trad_week_from_opening_7_5_2) post

estimates store trad_MW_WNC_all


*plotting the coefficients
coefplot (hybrid_MW_WNC_all, label(Hybrid) mlcolor(black) mcolor(gs12) ciopts(recast(rcap) color(gs10)))   (trad_MW_WNC_all, label(Traditional) mlcolor(black) mcolor(gs2) ciopts(recast(rcap) color(gs2))), yline(0, lcolor(black) lpattern(dash)) vertical rename(1.hybrid_week_from_opening_7_5_2 = 1.trad_week_from_opening_7_5_2 2.hybrid_week_from_opening_7_5_2 = 2.trad_week_from_opening_7_5_2 3.hybrid_week_from_opening_7_5_2 = 3.trad_week_from_opening_7_5_2 4.hybrid_week_from_opening_7_5_2 = 4.trad_week_from_opening_7_5_2 5.hybrid_week_from_opening_7_5_2 = 5.trad_week_from_opening_7_5_2 6.hybrid_week_from_opening_7_5_2 = 6.trad_week_from_opening_7_5_2 7.hybrid_week_from_opening_7_5_2 = 7.trad_week_from_opening_7_5_2 8.hybrid_week_from_opening_7_5_2 = 8.trad_week_from_opening_7_5_2 9.hybrid_week_from_opening_7_5_2 = 9.trad_week_from_opening_7_5_2 10.hybrid_week_from_opening_7_5_2 = 10.trad_week_from_opening_7_5_2 11.hybrid_week_from_opening_7_5_2 = 11.trad_week_from_opening_7_5_2 12.hybrid_week_from_opening_7_5_2 = 12.trad_week_from_opening_7_5_2 13.hybrid_week_from_opening_7_5_2 = 13.trad_week_from_opening_7_5_2 14.hybrid_week_from_opening_7_5_2 = 14.trad_week_from_opening_7_5_2 15.hybrid_week_from_opening_7_5_2 = 15.trad_week_from_opening_7_5_2 16.hybrid_week_from_opening_7_5_2 = 16.trad_week_from_opening_7_5_2 17.hybrid_week_from_opening_7_5_2 = 17.trad_week_from_opening_7_5_2 18.hybrid_week_from_opening_7_5_2 = 18.trad_week_from_opening_7_5_2) coeflabels(1.trad_week_from_opening_7_5_2 = "-4" 2.trad_week_from_opening_7_5_2 = "-3" 3.trad_week_from_opening_7_5_2 = "-2" 4.trad_week_from_opening_7_5_2 = "-1" 5.trad_week_from_opening_7_5_2 = "0" 6.trad_week_from_opening_7_5_2 = "1" 7.trad_week_from_opening_7_5_2 = "2" 8.trad_week_from_opening_7_5_2 = "3" 9.trad_week_from_opening_7_5_2 = "4" 10.trad_week_from_opening_7_5_2 = "5" 11.trad_week_from_opening_7_5_2  = "6" 12.trad_week_from_opening_7_5_2 = "7" 13.trad_week_from_opening_7_5_2 = "8" 14.trad_week_from_opening_7_5_2 = "9" 15.trad_week_from_opening_7_5_2 = "10" 16.trad_week_from_opening_7_5_2 = "11" 17.trad_week_from_opening_7_5_2 = "12" 18.trad_week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)


graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Cases - MW West North Central - All Ages - 210601.gph", replace
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Cases - MW West North Central - All Ages - 210601.jpg", as(jpg) name("Graph") quality(100) replace






*South Atlantic
poisson cases_per_pop_100K i.open1_mean_cat_all i.week_from_opening_7_5_2 i.hybrid_week_from_opening_7_5_2 i.trad_week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if division == 6 & week_from_opening_7_5_2 < 18,  vce(robust)

margins, dydx(hybrid_week_from_opening_7_5_2) post

estimates store hybrid_S_SA_all

poisson cases_per_pop_100K i.open1_mean_cat_all i.week_from_opening_7_5_2 i.hybrid_week_from_opening_7_5_2 i.trad_week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if division == 6 & week_from_opening_7_5_2 < 18,  vce(robust)

margins, dydx(trad_week_from_opening_7_5_2) post

estimates store trad_S_SA_all


*plotting the coefficients
coefplot (hybrid_S_SA_all, label(Hybrid) mlcolor(black) mcolor(gs12) ciopts(recast(rcap) color(gs10)))   (trad_S_SA_all, label(Traditional) mlcolor(black) mcolor(gs2) ciopts(recast(rcap) color(gs2))), yline(0, lcolor(black) lpattern(dash)) vertical rename(1.hybrid_week_from_opening_7_5_2 = 1.trad_week_from_opening_7_5_2 2.hybrid_week_from_opening_7_5_2 = 2.trad_week_from_opening_7_5_2 3.hybrid_week_from_opening_7_5_2 = 3.trad_week_from_opening_7_5_2 4.hybrid_week_from_opening_7_5_2 = 4.trad_week_from_opening_7_5_2 5.hybrid_week_from_opening_7_5_2 = 5.trad_week_from_opening_7_5_2 6.hybrid_week_from_opening_7_5_2 = 6.trad_week_from_opening_7_5_2 7.hybrid_week_from_opening_7_5_2 = 7.trad_week_from_opening_7_5_2 8.hybrid_week_from_opening_7_5_2 = 8.trad_week_from_opening_7_5_2 9.hybrid_week_from_opening_7_5_2 = 9.trad_week_from_opening_7_5_2 10.hybrid_week_from_opening_7_5_2 = 10.trad_week_from_opening_7_5_2 11.hybrid_week_from_opening_7_5_2 = 11.trad_week_from_opening_7_5_2 12.hybrid_week_from_opening_7_5_2 = 12.trad_week_from_opening_7_5_2 13.hybrid_week_from_opening_7_5_2 = 13.trad_week_from_opening_7_5_2 14.hybrid_week_from_opening_7_5_2 = 14.trad_week_from_opening_7_5_2 15.hybrid_week_from_opening_7_5_2 = 15.trad_week_from_opening_7_5_2 16.hybrid_week_from_opening_7_5_2 = 16.trad_week_from_opening_7_5_2 17.hybrid_week_from_opening_7_5_2 = 17.trad_week_from_opening_7_5_2 18.hybrid_week_from_opening_7_5_2 = 18.trad_week_from_opening_7_5_2) coeflabels(1.trad_week_from_opening_7_5_2 = "-4" 2.trad_week_from_opening_7_5_2 = "-3" 3.trad_week_from_opening_7_5_2 = "-2" 4.trad_week_from_opening_7_5_2 = "-1" 5.trad_week_from_opening_7_5_2 = "0" 6.trad_week_from_opening_7_5_2 = "1" 7.trad_week_from_opening_7_5_2 = "2" 8.trad_week_from_opening_7_5_2 = "3" 9.trad_week_from_opening_7_5_2 = "4" 10.trad_week_from_opening_7_5_2 = "5" 11.trad_week_from_opening_7_5_2  = "6" 12.trad_week_from_opening_7_5_2 = "7" 13.trad_week_from_opening_7_5_2 = "8" 14.trad_week_from_opening_7_5_2 = "9" 15.trad_week_from_opening_7_5_2 = "10" 16.trad_week_from_opening_7_5_2 = "11" 17.trad_week_from_opening_7_5_2 = "12" 18.trad_week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)


graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Cases - S South Atlantic - All Ages - 210601.gph"
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Cases - S South Atlantic - All Ages - 210601.jpg", as(jpg) name("Graph") quality(100) replace




*East South Central
poisson cases_per_pop_100K i.open1_mean_cat_all i.week_from_opening_7_5_2 i.hybrid_week_from_opening_7_5_2 i.trad_week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if division == 7 & week_from_opening_7_5_2 < 18,  vce(robust)

margins, dydx(hybrid_week_from_opening_7_5_2) post

estimates store hybrid_S_ESC_all

poisson cases_per_pop_100K i.open1_mean_cat_all i.week_from_opening_7_5_2 i.hybrid_week_from_opening_7_5_2 i.trad_week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if division == 7 & week_from_opening_7_5_2 < 18,  vce(robust)

margins, dydx(trad_week_from_opening_7_5_2) post

estimates store trad_S_ESC_all


*plotting the coefficients
coefplot (hybrid_S_ESC_all, label(Hybrid) mlcolor(black) mcolor(gs12) ciopts(recast(rcap) color(gs10)))   (trad_S_ESC_all, label(Traditional) mlcolor(black) mcolor(gs2) ciopts(recast(rcap) color(gs2))), yline(0, lcolor(black) lpattern(dash)) vertical rename(1.hybrid_week_from_opening_7_5_2 = 1.trad_week_from_opening_7_5_2 2.hybrid_week_from_opening_7_5_2 = 2.trad_week_from_opening_7_5_2 3.hybrid_week_from_opening_7_5_2 = 3.trad_week_from_opening_7_5_2 4.hybrid_week_from_opening_7_5_2 = 4.trad_week_from_opening_7_5_2 5.hybrid_week_from_opening_7_5_2 = 5.trad_week_from_opening_7_5_2 6.hybrid_week_from_opening_7_5_2 = 6.trad_week_from_opening_7_5_2 7.hybrid_week_from_opening_7_5_2 = 7.trad_week_from_opening_7_5_2 8.hybrid_week_from_opening_7_5_2 = 8.trad_week_from_opening_7_5_2 9.hybrid_week_from_opening_7_5_2 = 9.trad_week_from_opening_7_5_2 10.hybrid_week_from_opening_7_5_2 = 10.trad_week_from_opening_7_5_2 11.hybrid_week_from_opening_7_5_2 = 11.trad_week_from_opening_7_5_2 12.hybrid_week_from_opening_7_5_2 = 12.trad_week_from_opening_7_5_2 13.hybrid_week_from_opening_7_5_2 = 13.trad_week_from_opening_7_5_2 14.hybrid_week_from_opening_7_5_2 = 14.trad_week_from_opening_7_5_2 15.hybrid_week_from_opening_7_5_2 = 15.trad_week_from_opening_7_5_2 16.hybrid_week_from_opening_7_5_2 = 16.trad_week_from_opening_7_5_2 17.hybrid_week_from_opening_7_5_2 = 17.trad_week_from_opening_7_5_2 18.hybrid_week_from_opening_7_5_2 = 18.trad_week_from_opening_7_5_2) coeflabels(1.trad_week_from_opening_7_5_2 = "-4" 2.trad_week_from_opening_7_5_2 = "-3" 3.trad_week_from_opening_7_5_2 = "-2" 4.trad_week_from_opening_7_5_2 = "-1" 5.trad_week_from_opening_7_5_2 = "0" 6.trad_week_from_opening_7_5_2 = "1" 7.trad_week_from_opening_7_5_2 = "2" 8.trad_week_from_opening_7_5_2 = "3" 9.trad_week_from_opening_7_5_2 = "4" 10.trad_week_from_opening_7_5_2 = "5" 11.trad_week_from_opening_7_5_2  = "6" 12.trad_week_from_opening_7_5_2 = "7" 13.trad_week_from_opening_7_5_2 = "8" 14.trad_week_from_opening_7_5_2 = "9" 15.trad_week_from_opening_7_5_2 = "10" 16.trad_week_from_opening_7_5_2 = "11" 17.trad_week_from_opening_7_5_2 = "12" 18.trad_week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)


graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Cases - S East South Central - All Ages - 210601.gph", replace
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Cases - S East South Central - All Ages - 210601.jpg", as(jpg) name("Graph") quality(100) replace




*West South Central
poisson cases_per_pop_100K i.open1_mean_cat_all i.week_from_opening_7_5_2 i.hybrid_week_from_opening_7_5_2 i.trad_week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if division == 8 & week_from_opening_7_5_2 < 18,  vce(robust)

margins, dydx(hybrid_week_from_opening_7_5_2) post

estimates store hybrid_S_WSC_all

poisson cases_per_pop_100K i.open1_mean_cat_all i.week_from_opening_7_5_2 i.hybrid_week_from_opening_7_5_2 i.trad_week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if division == 8 & week_from_opening_7_5_2 < 18,  vce(robust)

margins, dydx(trad_week_from_opening_7_5_2) post

estimates store trad_S_WSC_all


*plotting the coefficients
coefplot (hybrid_S_WSC_all, label(Hybrid) mlcolor(black) mcolor(gs12) ciopts(recast(rcap) color(gs10)))   (trad_S_WSC_all, label(Traditional) mlcolor(black) mcolor(gs2) ciopts(recast(rcap) color(gs2))), yline(0, lcolor(black) lpattern(dash)) vertical rename(1.hybrid_week_from_opening_7_5_2 = 1.trad_week_from_opening_7_5_2 2.hybrid_week_from_opening_7_5_2 = 2.trad_week_from_opening_7_5_2 3.hybrid_week_from_opening_7_5_2 = 3.trad_week_from_opening_7_5_2 4.hybrid_week_from_opening_7_5_2 = 4.trad_week_from_opening_7_5_2 5.hybrid_week_from_opening_7_5_2 = 5.trad_week_from_opening_7_5_2 6.hybrid_week_from_opening_7_5_2 = 6.trad_week_from_opening_7_5_2 7.hybrid_week_from_opening_7_5_2 = 7.trad_week_from_opening_7_5_2 8.hybrid_week_from_opening_7_5_2 = 8.trad_week_from_opening_7_5_2 9.hybrid_week_from_opening_7_5_2 = 9.trad_week_from_opening_7_5_2 10.hybrid_week_from_opening_7_5_2 = 10.trad_week_from_opening_7_5_2 11.hybrid_week_from_opening_7_5_2 = 11.trad_week_from_opening_7_5_2 12.hybrid_week_from_opening_7_5_2 = 12.trad_week_from_opening_7_5_2 13.hybrid_week_from_opening_7_5_2 = 13.trad_week_from_opening_7_5_2 14.hybrid_week_from_opening_7_5_2 = 14.trad_week_from_opening_7_5_2 15.hybrid_week_from_opening_7_5_2 = 15.trad_week_from_opening_7_5_2 16.hybrid_week_from_opening_7_5_2 = 16.trad_week_from_opening_7_5_2 17.hybrid_week_from_opening_7_5_2 = 17.trad_week_from_opening_7_5_2 18.hybrid_week_from_opening_7_5_2 = 18.trad_week_from_opening_7_5_2) coeflabels(1.trad_week_from_opening_7_5_2 = "-4" 2.trad_week_from_opening_7_5_2 = "-3" 3.trad_week_from_opening_7_5_2 = "-2" 4.trad_week_from_opening_7_5_2 = "-1" 5.trad_week_from_opening_7_5_2 = "0" 6.trad_week_from_opening_7_5_2 = "1" 7.trad_week_from_opening_7_5_2 = "2" 8.trad_week_from_opening_7_5_2 = "3" 9.trad_week_from_opening_7_5_2 = "4" 10.trad_week_from_opening_7_5_2 = "5" 11.trad_week_from_opening_7_5_2  = "6" 12.trad_week_from_opening_7_5_2 = "7" 13.trad_week_from_opening_7_5_2 = "8" 14.trad_week_from_opening_7_5_2 = "9" 15.trad_week_from_opening_7_5_2 = "10" 16.trad_week_from_opening_7_5_2 = "11" 17.trad_week_from_opening_7_5_2 = "12" 18.trad_week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)


graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Cases - S West South Central - All Ages - 210601.gph", replace
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Cases - S West South Central - All Ages - 210601.jpg", as(jpg) name("Graph") quality(100) replace




















*******OLD ANALYSES**********

**************************************
***GLM gamma distribution, log link***
**************************************
***COVID CASES****
**Whole Country***
*all ages*
*running it once and saving the estimates as hybrid
glm cases_per_pop_100K i.open1_mean_cat_all i.week_from_opening_7_5_2 i.hybrid_week_from_opening_7_5_2 i.trad_week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips, f(gamma) l(log) vce(cluster fips)

margins, dydx(hybrid_week_from_opening_7_5_2) post

estimates store hybrid_all_all

*running it again and saving the estimates as traditional
glm cases_per_pop_100K i.open1_mean_cat_all i.week_from_opening_7_5_2 i.hybrid_week_from_opening_7_5_2 i.trad_week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips, f(gamma) l(log) vce(cluster fips)

margins, dydx(trad_week_from_opening_7_5_2) post

estimates store trad_all_all

*plotting the coefficients
coefplot (hybrid_all_all, label(Hybrid) mlcolor(black) mcolor(gs12) ciopts(color(gs10)))   (trad_all_all, label(Traditional) mlcolor(black) mcolor(gs2) ciopts(color(gs2))), yline(0, lcolor(black) lpattern(dash)) vertical rename(1.hybrid_week_from_opening_7_5_2 = 1.trad_week_from_opening_7_5_2 2.hybrid_week_from_opening_7_5_2 = 2.trad_week_from_opening_7_5_2 3.hybrid_week_from_opening_7_5_2 = 3.trad_week_from_opening_7_5_2 4.hybrid_week_from_opening_7_5_2 = 4.trad_week_from_opening_7_5_2 5.hybrid_week_from_opening_7_5_2 = 5.trad_week_from_opening_7_5_2 6.hybrid_week_from_opening_7_5_2 = 6.trad_week_from_opening_7_5_2 7.hybrid_week_from_opening_7_5_2 = 7.trad_week_from_opening_7_5_2 8.hybrid_week_from_opening_7_5_2 = 8.trad_week_from_opening_7_5_2 9.hybrid_week_from_opening_7_5_2 = 9.trad_week_from_opening_7_5_2 10.hybrid_week_from_opening_7_5_2 = 10.trad_week_from_opening_7_5_2 11.hybrid_week_from_opening_7_5_2 = 11.trad_week_from_opening_7_5_2 12.hybrid_week_from_opening_7_5_2 = 12.trad_week_from_opening_7_5_2 13.hybrid_week_from_opening_7_5_2 = 13.trad_week_from_opening_7_5_2 14.hybrid_week_from_opening_7_5_2 = 14.trad_week_from_opening_7_5_2 15.hybrid_week_from_opening_7_5_2 = 15.trad_week_from_opening_7_5_2 16.hybrid_week_from_opening_7_5_2 = 16.trad_week_from_opening_7_5_2 17.hybrid_week_from_opening_7_5_2 = 17.trad_week_from_opening_7_5_2 18.hybrid_week_from_opening_7_5_2 = 18.trad_week_from_opening_7_5_2) coeflabels(1.trad_week_from_opening_7_5_2 = "-4" 2.trad_week_from_opening_7_5_2 = "-3" 3.trad_week_from_opening_7_5_2 = "-2" 4.trad_week_from_opening_7_5_2 = "-1" 5.trad_week_from_opening_7_5_2 = "0" 6.trad_week_from_opening_7_5_2 = "1" 7.trad_week_from_opening_7_5_2 = "2" 8.trad_week_from_opening_7_5_2 = "3" 9.trad_week_from_opening_7_5_2 = "4" 10.trad_week_from_opening_7_5_2 = "5" 11.trad_week_from_opening_7_5_2  = "6" 12.trad_week_from_opening_7_5_2 = "7" 13.trad_week_from_opening_7_5_2 = "8" 14.trad_week_from_opening_7_5_2 = "9" 15.trad_week_from_opening_7_5_2 = "10" 16.trad_week_from_opening_7_5_2 = "11" 17.trad_week_from_opening_7_5_2 = "12" 18.trad_week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)


graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Cases - Whole Country - All Ages - 210419.gph"
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Cases - Whole Country - All Ages - 210419.jpg", as(jpg) name("Graph") quality(100)




*ages 0-9*
*running it once and saving the estimates as hybrid
glm cases_per_pop_0_9_100K i.open1_mean_cat_all i.week_from_opening_7_5_2 i.hybrid_week_from_opening_7_5_2 i.trad_week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips, f(gamma) l(log) vce(cluster fips)

margins, dydx(hybrid_week_from_opening_7_5_2) post

estimates store hybrid_all_0_9

*running it again and saving the estimates as traditional
glm cases_per_pop_0_9_100K i.open1_mean_cat_all i.week_from_opening_7_5_2 i.hybrid_week_from_opening_7_5_2 i.trad_week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips, f(gamma) l(log) vce(cluster fips)

margins, dydx(trad_week_from_opening_7_5_2) post

estimates store trad_all_0_9

*plotting the coefficients
coefplot (hybrid_all_0_9, label(Hybrid) mlcolor(black) mcolor(gs12) ciopts(color(gs10)))   (trad_all_0_9, label(Traditional) mlcolor(black) mcolor(gs2) ciopts(color(gs2))), yline(0, lcolor(black) lpattern(dash)) vertical rename(1.hybrid_week_from_opening_7_5_2 = 1.trad_week_from_opening_7_5_2 2.hybrid_week_from_opening_7_5_2 = 2.trad_week_from_opening_7_5_2 3.hybrid_week_from_opening_7_5_2 = 3.trad_week_from_opening_7_5_2 4.hybrid_week_from_opening_7_5_2 = 4.trad_week_from_opening_7_5_2 5.hybrid_week_from_opening_7_5_2 = 5.trad_week_from_opening_7_5_2 6.hybrid_week_from_opening_7_5_2 = 6.trad_week_from_opening_7_5_2 7.hybrid_week_from_opening_7_5_2 = 7.trad_week_from_opening_7_5_2 8.hybrid_week_from_opening_7_5_2 = 8.trad_week_from_opening_7_5_2 9.hybrid_week_from_opening_7_5_2 = 9.trad_week_from_opening_7_5_2 10.hybrid_week_from_opening_7_5_2 = 10.trad_week_from_opening_7_5_2 11.hybrid_week_from_opening_7_5_2 = 11.trad_week_from_opening_7_5_2 12.hybrid_week_from_opening_7_5_2 = 12.trad_week_from_opening_7_5_2 13.hybrid_week_from_opening_7_5_2 = 13.trad_week_from_opening_7_5_2 14.hybrid_week_from_opening_7_5_2 = 14.trad_week_from_opening_7_5_2 15.hybrid_week_from_opening_7_5_2 = 15.trad_week_from_opening_7_5_2 16.hybrid_week_from_opening_7_5_2 = 16.trad_week_from_opening_7_5_2 17.hybrid_week_from_opening_7_5_2 = 17.trad_week_from_opening_7_5_2 18.hybrid_week_from_opening_7_5_2 = 18.trad_week_from_opening_7_5_2) coeflabels(1.trad_week_from_opening_7_5_2 = "-4" 2.trad_week_from_opening_7_5_2 = "-3" 3.trad_week_from_opening_7_5_2 = "-2" 4.trad_week_from_opening_7_5_2 = "-1" 5.trad_week_from_opening_7_5_2 = "0" 6.trad_week_from_opening_7_5_2 = "1" 7.trad_week_from_opening_7_5_2 = "2" 8.trad_week_from_opening_7_5_2 = "3" 9.trad_week_from_opening_7_5_2 = "4" 10.trad_week_from_opening_7_5_2 = "5" 11.trad_week_from_opening_7_5_2  = "6" 12.trad_week_from_opening_7_5_2 = "7" 13.trad_week_from_opening_7_5_2 = "8" 14.trad_week_from_opening_7_5_2 = "9" 15.trad_week_from_opening_7_5_2 = "10" 16.trad_week_from_opening_7_5_2 = "11" 17.trad_week_from_opening_7_5_2 = "12" 18.trad_week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)


graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Cases - Whole Country - 0-9 - 210419.gph"
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Cases - Whole Country - 0-9 - 210419.jpg", as(jpg) name("Graph") quality(100)




*ages 10-19*
*running it once and saving the estimates as hybrid
glm cases_per_pop_10_19_100K i.open1_mean_cat_all i.week_from_opening_7_5_2 i.hybrid_week_from_opening_7_5_2 i.trad_week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips, f(gamma) l(log) vce(cluster fips)

margins, dydx(hybrid_week_from_opening_7_5_2) post

estimates store hybrid_all_10_19

*running it again and saving the estimates as traditional
glm cases_per_pop_10_19_100K i.open1_mean_cat_all i.week_from_opening_7_5_2 i.hybrid_week_from_opening_7_5_2 i.trad_week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips, f(gamma) l(log) vce(cluster fips)

margins, dydx(trad_week_from_opening_7_5_2) post

estimates store trad_all_10_19

*plotting the coefficients
coefplot (hybrid_all_10_19, label(Hybrid) mlcolor(black) mcolor(gs12) ciopts(color(gs10)))   (trad_all_10_19, label(Traditional) mlcolor(black) mcolor(gs2) ciopts(color(gs2))), yline(0, lcolor(black) lpattern(dash)) vertical rename(1.hybrid_week_from_opening_7_5_2 = 1.trad_week_from_opening_7_5_2 2.hybrid_week_from_opening_7_5_2 = 2.trad_week_from_opening_7_5_2 3.hybrid_week_from_opening_7_5_2 = 3.trad_week_from_opening_7_5_2 4.hybrid_week_from_opening_7_5_2 = 4.trad_week_from_opening_7_5_2 5.hybrid_week_from_opening_7_5_2 = 5.trad_week_from_opening_7_5_2 6.hybrid_week_from_opening_7_5_2 = 6.trad_week_from_opening_7_5_2 7.hybrid_week_from_opening_7_5_2 = 7.trad_week_from_opening_7_5_2 8.hybrid_week_from_opening_7_5_2 = 8.trad_week_from_opening_7_5_2 9.hybrid_week_from_opening_7_5_2 = 9.trad_week_from_opening_7_5_2 10.hybrid_week_from_opening_7_5_2 = 10.trad_week_from_opening_7_5_2 11.hybrid_week_from_opening_7_5_2 = 11.trad_week_from_opening_7_5_2 12.hybrid_week_from_opening_7_5_2 = 12.trad_week_from_opening_7_5_2 13.hybrid_week_from_opening_7_5_2 = 13.trad_week_from_opening_7_5_2 14.hybrid_week_from_opening_7_5_2 = 14.trad_week_from_opening_7_5_2 15.hybrid_week_from_opening_7_5_2 = 15.trad_week_from_opening_7_5_2 16.hybrid_week_from_opening_7_5_2 = 16.trad_week_from_opening_7_5_2 17.hybrid_week_from_opening_7_5_2 = 17.trad_week_from_opening_7_5_2 18.hybrid_week_from_opening_7_5_2 = 18.trad_week_from_opening_7_5_2) coeflabels(1.trad_week_from_opening_7_5_2 = "-4" 2.trad_week_from_opening_7_5_2 = "-3" 3.trad_week_from_opening_7_5_2 = "-2" 4.trad_week_from_opening_7_5_2 = "-1" 5.trad_week_from_opening_7_5_2 = "0" 6.trad_week_from_opening_7_5_2 = "1" 7.trad_week_from_opening_7_5_2 = "2" 8.trad_week_from_opening_7_5_2 = "3" 9.trad_week_from_opening_7_5_2 = "4" 10.trad_week_from_opening_7_5_2 = "5" 11.trad_week_from_opening_7_5_2  = "6" 12.trad_week_from_opening_7_5_2 = "7" 13.trad_week_from_opening_7_5_2 = "8" 14.trad_week_from_opening_7_5_2 = "9" 15.trad_week_from_opening_7_5_2 = "10" 16.trad_week_from_opening_7_5_2 = "11" 17.trad_week_from_opening_7_5_2 = "12" 18.trad_week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)


graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Cases - Whole Country - 10-19 - 210419.gph"
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Cases - Whole Country - 10-19 - 210419.jpg", as(jpg) name("Graph") quality(100)





*ages 20+*
*running it once and saving the estimates as hybrid
glm cases_per_pop_20_100K i.open1_mean_cat_all i.week_from_opening_7_5_2 i.hybrid_week_from_opening_7_5_2 i.trad_week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips, f(gamma) l(log) vce(cluster fips)

margins, dydx(hybrid_week_from_opening_7_5_2) post

estimates store hybrid_all_20

*running it again and saving the estimates as traditional
glm cases_per_pop_20_100K i.open1_mean_cat_all i.week_from_opening_7_5_2 i.hybrid_week_from_opening_7_5_2 i.trad_week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips, f(gamma) l(log) vce(cluster fips)

margins, dydx(trad_week_from_opening_7_5_2) post

estimates store trad_all_20

*plotting the coefficients
coefplot (hybrid_all_20, label(Hybrid) mlcolor(black) mcolor(gs12) ciopts(color(gs10)))   (trad_all_20, label(Traditional) mlcolor(black) mcolor(gs2) ciopts(color(gs2))), yline(0, lcolor(black) lpattern(dash)) vertical rename(1.hybrid_week_from_opening_7_5_2 = 1.trad_week_from_opening_7_5_2 2.hybrid_week_from_opening_7_5_2 = 2.trad_week_from_opening_7_5_2 3.hybrid_week_from_opening_7_5_2 = 3.trad_week_from_opening_7_5_2 4.hybrid_week_from_opening_7_5_2 = 4.trad_week_from_opening_7_5_2 5.hybrid_week_from_opening_7_5_2 = 5.trad_week_from_opening_7_5_2 6.hybrid_week_from_opening_7_5_2 = 6.trad_week_from_opening_7_5_2 7.hybrid_week_from_opening_7_5_2 = 7.trad_week_from_opening_7_5_2 8.hybrid_week_from_opening_7_5_2 = 8.trad_week_from_opening_7_5_2 9.hybrid_week_from_opening_7_5_2 = 9.trad_week_from_opening_7_5_2 10.hybrid_week_from_opening_7_5_2 = 10.trad_week_from_opening_7_5_2 11.hybrid_week_from_opening_7_5_2 = 11.trad_week_from_opening_7_5_2 12.hybrid_week_from_opening_7_5_2 = 12.trad_week_from_opening_7_5_2 13.hybrid_week_from_opening_7_5_2 = 13.trad_week_from_opening_7_5_2 14.hybrid_week_from_opening_7_5_2 = 14.trad_week_from_opening_7_5_2 15.hybrid_week_from_opening_7_5_2 = 15.trad_week_from_opening_7_5_2 16.hybrid_week_from_opening_7_5_2 = 16.trad_week_from_opening_7_5_2 17.hybrid_week_from_opening_7_5_2 = 17.trad_week_from_opening_7_5_2 18.hybrid_week_from_opening_7_5_2 = 18.trad_week_from_opening_7_5_2) coeflabels(1.trad_week_from_opening_7_5_2 = "-4" 2.trad_week_from_opening_7_5_2 = "-3" 3.trad_week_from_opening_7_5_2 = "-2" 4.trad_week_from_opening_7_5_2 = "-1" 5.trad_week_from_opening_7_5_2 = "0" 6.trad_week_from_opening_7_5_2 = "1" 7.trad_week_from_opening_7_5_2 = "2" 8.trad_week_from_opening_7_5_2 = "3" 9.trad_week_from_opening_7_5_2 = "4" 10.trad_week_from_opening_7_5_2 = "5" 11.trad_week_from_opening_7_5_2  = "6" 12.trad_week_from_opening_7_5_2 = "7" 13.trad_week_from_opening_7_5_2 = "8" 14.trad_week_from_opening_7_5_2 = "9" 15.trad_week_from_opening_7_5_2 = "10" 16.trad_week_from_opening_7_5_2 = "11" 17.trad_week_from_opening_7_5_2 = "12" 18.trad_week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)


graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Cases - Whole Country - 20+ - 210419.gph"
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Cases - Whole Country - 20+ - 210419.jpg", as(jpg) name("Graph") quality(100)




**NE***
*all ages*
*running it once and saving the estimates as hybrid
glm cases_per_pop_100K i.open1_mean_cat_all i.week_from_opening_7_5_2 i.hybrid_week_from_opening_7_5_2 i.trad_week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if region == 0 & week_from_opening_7_5_2 < 18, f(gamma) l(log) vce(cluster fips)

margins, dydx(hybrid_week_from_opening_7_5_2) post

estimates store hybrid_NE_all

*running it again and saving the estimates as traditional
glm cases_per_pop_100K i.open1_mean_cat_all i.week_from_opening_7_5_2 i.hybrid_week_from_opening_7_5_2 i.trad_week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if region == 0 & week_from_opening_7_5_2 < 18, f(gamma) l(log) vce(cluster fips)

margins, dydx(trad_week_from_opening_7_5_2) post

estimates store trad_NE_all

*plotting the coefficients
coefplot (hybrid_NE_all, label(Hybrid) mlcolor(black) mcolor(gs12) ciopts(color(gs10)))   (trad_NE_all, label(Traditional) mlcolor(black) mcolor(gs2) ciopts(color(gs2))), yline(0, lcolor(black) lpattern(dash)) vertical rename(1.hybrid_week_from_opening_7_5_2 = 1.trad_week_from_opening_7_5_2 2.hybrid_week_from_opening_7_5_2 = 2.trad_week_from_opening_7_5_2 3.hybrid_week_from_opening_7_5_2 = 3.trad_week_from_opening_7_5_2 4.hybrid_week_from_opening_7_5_2 = 4.trad_week_from_opening_7_5_2 5.hybrid_week_from_opening_7_5_2 = 5.trad_week_from_opening_7_5_2 6.hybrid_week_from_opening_7_5_2 = 6.trad_week_from_opening_7_5_2 7.hybrid_week_from_opening_7_5_2 = 7.trad_week_from_opening_7_5_2 8.hybrid_week_from_opening_7_5_2 = 8.trad_week_from_opening_7_5_2 9.hybrid_week_from_opening_7_5_2 = 9.trad_week_from_opening_7_5_2 10.hybrid_week_from_opening_7_5_2 = 10.trad_week_from_opening_7_5_2 11.hybrid_week_from_opening_7_5_2 = 11.trad_week_from_opening_7_5_2 12.hybrid_week_from_opening_7_5_2 = 12.trad_week_from_opening_7_5_2 13.hybrid_week_from_opening_7_5_2 = 13.trad_week_from_opening_7_5_2 14.hybrid_week_from_opening_7_5_2 = 14.trad_week_from_opening_7_5_2 15.hybrid_week_from_opening_7_5_2 = 15.trad_week_from_opening_7_5_2 16.hybrid_week_from_opening_7_5_2 = 16.trad_week_from_opening_7_5_2 17.hybrid_week_from_opening_7_5_2 = 17.trad_week_from_opening_7_5_2 18.hybrid_week_from_opening_7_5_2 = 18.trad_week_from_opening_7_5_2) coeflabels(1.trad_week_from_opening_7_5_2 = "-4" 2.trad_week_from_opening_7_5_2 = "-3" 3.trad_week_from_opening_7_5_2 = "-2" 4.trad_week_from_opening_7_5_2 = "-1" 5.trad_week_from_opening_7_5_2 = "0" 6.trad_week_from_opening_7_5_2 = "1" 7.trad_week_from_opening_7_5_2 = "2" 8.trad_week_from_opening_7_5_2 = "3" 9.trad_week_from_opening_7_5_2 = "4" 10.trad_week_from_opening_7_5_2 = "5" 11.trad_week_from_opening_7_5_2  = "6" 12.trad_week_from_opening_7_5_2 = "7" 13.trad_week_from_opening_7_5_2 = "8" 14.trad_week_from_opening_7_5_2 = "9" 15.trad_week_from_opening_7_5_2 = "10" 16.trad_week_from_opening_7_5_2 = "11" 17.trad_week_from_opening_7_5_2 = "12" 18.trad_week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)


graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Cases - NE - All Ages - 210507.gph"
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Cases - NE - All Ages - 210507.jpg", as(jpg) name("Graph") quality(100)



*0-9*
*running it once and saving the estimates as hybrid
glm cases_per_pop_0_9_100K i.open1_mean_cat_all i.week_from_opening_7_5_2 i.hybrid_week_from_opening_7_5_2 i.trad_week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if region == 0, f(gamma) l(log) vce(cluster fips)

margins, dydx(hybrid_week_from_opening_7_5_2) post

estimates store hybrid_NE_0_9

*running it again and saving the estimates as traditional
glm cases_per_pop_0_9_100K i.open1_mean_cat_all i.week_from_opening_7_5_2 i.hybrid_week_from_opening_7_5_2 i.trad_week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if region == 0, f(gamma) l(log) vce(cluster fips)

margins, dydx(trad_week_from_opening_7_5_2) post

estimates store trad_NE_0_9

*plotting the coefficients
coefplot (hybrid_NE_0_9, label(Hybrid) mlcolor(black) mcolor(gs12) ciopts(color(gs10)))   (trad_NE_0_9, label(Traditional) mlcolor(black) mcolor(gs2) ciopts(color(gs2))), yline(0, lcolor(black) lpattern(dash)) vertical rename(1.hybrid_week_from_opening_7_5_2 = 1.trad_week_from_opening_7_5_2 2.hybrid_week_from_opening_7_5_2 = 2.trad_week_from_opening_7_5_2 3.hybrid_week_from_opening_7_5_2 = 3.trad_week_from_opening_7_5_2 4.hybrid_week_from_opening_7_5_2 = 4.trad_week_from_opening_7_5_2 5.hybrid_week_from_opening_7_5_2 = 5.trad_week_from_opening_7_5_2 6.hybrid_week_from_opening_7_5_2 = 6.trad_week_from_opening_7_5_2 7.hybrid_week_from_opening_7_5_2 = 7.trad_week_from_opening_7_5_2 8.hybrid_week_from_opening_7_5_2 = 8.trad_week_from_opening_7_5_2 9.hybrid_week_from_opening_7_5_2 = 9.trad_week_from_opening_7_5_2 10.hybrid_week_from_opening_7_5_2 = 10.trad_week_from_opening_7_5_2 11.hybrid_week_from_opening_7_5_2 = 11.trad_week_from_opening_7_5_2 12.hybrid_week_from_opening_7_5_2 = 12.trad_week_from_opening_7_5_2 13.hybrid_week_from_opening_7_5_2 = 13.trad_week_from_opening_7_5_2 14.hybrid_week_from_opening_7_5_2 = 14.trad_week_from_opening_7_5_2 15.hybrid_week_from_opening_7_5_2 = 15.trad_week_from_opening_7_5_2 16.hybrid_week_from_opening_7_5_2 = 16.trad_week_from_opening_7_5_2 17.hybrid_week_from_opening_7_5_2 = 17.trad_week_from_opening_7_5_2 18.hybrid_week_from_opening_7_5_2 = 18.trad_week_from_opening_7_5_2) coeflabels(1.trad_week_from_opening_7_5_2 = "-4" 2.trad_week_from_opening_7_5_2 = "-3" 3.trad_week_from_opening_7_5_2 = "-2" 4.trad_week_from_opening_7_5_2 = "-1" 5.trad_week_from_opening_7_5_2 = "0" 6.trad_week_from_opening_7_5_2 = "1" 7.trad_week_from_opening_7_5_2 = "2" 8.trad_week_from_opening_7_5_2 = "3" 9.trad_week_from_opening_7_5_2 = "4" 10.trad_week_from_opening_7_5_2 = "5" 11.trad_week_from_opening_7_5_2  = "6" 12.trad_week_from_opening_7_5_2 = "7" 13.trad_week_from_opening_7_5_2 = "8" 14.trad_week_from_opening_7_5_2 = "9" 15.trad_week_from_opening_7_5_2 = "10" 16.trad_week_from_opening_7_5_2 = "11" 17.trad_week_from_opening_7_5_2 = "12" 18.trad_week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)


graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Cases - NE - 0-9 - 210419.gph"
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Cases - NE - 0-9 - 210419.jpg", as(jpg) name("Graph") quality(100)





*10-19*
*running it once and saving the estimates as hybrid
glm cases_per_pop_10_19_100K i.open1_mean_cat_all i.week_from_opening_7_5_2 i.hybrid_week_from_opening_7_5_2 i.trad_week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if region == 0, f(gamma) l(log) vce(cluster fips)

margins, dydx(hybrid_week_from_opening_7_5_2) post

estimates store hybrid_NE_10_19

*running it again and saving the estimates as traditional
glm cases_per_pop_10_19_100K i.open1_mean_cat_all i.week_from_opening_7_5_2 i.hybrid_week_from_opening_7_5_2 i.trad_week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if region == 0, f(gamma) l(log) vce(cluster fips)

margins, dydx(trad_week_from_opening_7_5_2) post

estimates store trad_NE_10_19

*plotting the coefficients
coefplot (hybrid_NE_10_19, label(Hybrid) mlcolor(black) mcolor(gs12) ciopts(color(gs10)))   (trad_NE_10_19, label(Traditional) mlcolor(black) mcolor(gs2) ciopts(color(gs2))), yline(0, lcolor(black) lpattern(dash)) vertical rename(1.hybrid_week_from_opening_7_5_2 = 1.trad_week_from_opening_7_5_2 2.hybrid_week_from_opening_7_5_2 = 2.trad_week_from_opening_7_5_2 3.hybrid_week_from_opening_7_5_2 = 3.trad_week_from_opening_7_5_2 4.hybrid_week_from_opening_7_5_2 = 4.trad_week_from_opening_7_5_2 5.hybrid_week_from_opening_7_5_2 = 5.trad_week_from_opening_7_5_2 6.hybrid_week_from_opening_7_5_2 = 6.trad_week_from_opening_7_5_2 7.hybrid_week_from_opening_7_5_2 = 7.trad_week_from_opening_7_5_2 8.hybrid_week_from_opening_7_5_2 = 8.trad_week_from_opening_7_5_2 9.hybrid_week_from_opening_7_5_2 = 9.trad_week_from_opening_7_5_2 10.hybrid_week_from_opening_7_5_2 = 10.trad_week_from_opening_7_5_2 11.hybrid_week_from_opening_7_5_2 = 11.trad_week_from_opening_7_5_2 12.hybrid_week_from_opening_7_5_2 = 12.trad_week_from_opening_7_5_2 13.hybrid_week_from_opening_7_5_2 = 13.trad_week_from_opening_7_5_2 14.hybrid_week_from_opening_7_5_2 = 14.trad_week_from_opening_7_5_2 15.hybrid_week_from_opening_7_5_2 = 15.trad_week_from_opening_7_5_2 16.hybrid_week_from_opening_7_5_2 = 16.trad_week_from_opening_7_5_2 17.hybrid_week_from_opening_7_5_2 = 17.trad_week_from_opening_7_5_2 18.hybrid_week_from_opening_7_5_2 = 18.trad_week_from_opening_7_5_2) coeflabels(1.trad_week_from_opening_7_5_2 = "-4" 2.trad_week_from_opening_7_5_2 = "-3" 3.trad_week_from_opening_7_5_2 = "-2" 4.trad_week_from_opening_7_5_2 = "-1" 5.trad_week_from_opening_7_5_2 = "0" 6.trad_week_from_opening_7_5_2 = "1" 7.trad_week_from_opening_7_5_2 = "2" 8.trad_week_from_opening_7_5_2 = "3" 9.trad_week_from_opening_7_5_2 = "4" 10.trad_week_from_opening_7_5_2 = "5" 11.trad_week_from_opening_7_5_2  = "6" 12.trad_week_from_opening_7_5_2 = "7" 13.trad_week_from_opening_7_5_2 = "8" 14.trad_week_from_opening_7_5_2 = "9" 15.trad_week_from_opening_7_5_2 = "10" 16.trad_week_from_opening_7_5_2 = "11" 17.trad_week_from_opening_7_5_2 = "12" 18.trad_week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)


graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Cases - NE - 10-19 - 210419.gph"
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Cases - NE - 10-19 - 210419.jpg", as(jpg) name("Graph") quality(100)





*20+*
*running it once and saving the estimates as hybrid
glm cases_per_pop_20_100K i.open1_mean_cat_all i.week_from_opening_7_5_2 i.hybrid_week_from_opening_7_5_2 i.trad_week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if region == 0, f(gamma) l(log) vce(cluster fips)

margins, dydx(hybrid_week_from_opening_7_5_2) post

estimates store hybrid_NE_20

*running it again and saving the estimates as traditional
glm cases_per_pop_20_100K i.open1_mean_cat_all i.week_from_opening_7_5_2 i.hybrid_week_from_opening_7_5_2 i.trad_week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if region == 0, f(gamma) l(log) vce(cluster fips)

margins, dydx(trad_week_from_opening_7_5_2) post

estimates store trad_NE_20

*plotting the coefficients
coefplot (hybrid_NE_20, label(Hybrid) mlcolor(black) mcolor(gs12) ciopts(color(gs10)))   (trad_NE_20, label(Traditional) mlcolor(black) mcolor(gs2) ciopts(color(gs2))), yline(0, lcolor(black) lpattern(dash)) vertical rename(1.hybrid_week_from_opening_7_5_2 = 1.trad_week_from_opening_7_5_2 2.hybrid_week_from_opening_7_5_2 = 2.trad_week_from_opening_7_5_2 3.hybrid_week_from_opening_7_5_2 = 3.trad_week_from_opening_7_5_2 4.hybrid_week_from_opening_7_5_2 = 4.trad_week_from_opening_7_5_2 5.hybrid_week_from_opening_7_5_2 = 5.trad_week_from_opening_7_5_2 6.hybrid_week_from_opening_7_5_2 = 6.trad_week_from_opening_7_5_2 7.hybrid_week_from_opening_7_5_2 = 7.trad_week_from_opening_7_5_2 8.hybrid_week_from_opening_7_5_2 = 8.trad_week_from_opening_7_5_2 9.hybrid_week_from_opening_7_5_2 = 9.trad_week_from_opening_7_5_2 10.hybrid_week_from_opening_7_5_2 = 10.trad_week_from_opening_7_5_2 11.hybrid_week_from_opening_7_5_2 = 11.trad_week_from_opening_7_5_2 12.hybrid_week_from_opening_7_5_2 = 12.trad_week_from_opening_7_5_2 13.hybrid_week_from_opening_7_5_2 = 13.trad_week_from_opening_7_5_2 14.hybrid_week_from_opening_7_5_2 = 14.trad_week_from_opening_7_5_2 15.hybrid_week_from_opening_7_5_2 = 15.trad_week_from_opening_7_5_2 16.hybrid_week_from_opening_7_5_2 = 16.trad_week_from_opening_7_5_2 17.hybrid_week_from_opening_7_5_2 = 17.trad_week_from_opening_7_5_2 18.hybrid_week_from_opening_7_5_2 = 18.trad_week_from_opening_7_5_2) coeflabels(1.trad_week_from_opening_7_5_2 = "-4" 2.trad_week_from_opening_7_5_2 = "-3" 3.trad_week_from_opening_7_5_2 = "-2" 4.trad_week_from_opening_7_5_2 = "-1" 5.trad_week_from_opening_7_5_2 = "0" 6.trad_week_from_opening_7_5_2 = "1" 7.trad_week_from_opening_7_5_2 = "2" 8.trad_week_from_opening_7_5_2 = "3" 9.trad_week_from_opening_7_5_2 = "4" 10.trad_week_from_opening_7_5_2 = "5" 11.trad_week_from_opening_7_5_2  = "6" 12.trad_week_from_opening_7_5_2 = "7" 13.trad_week_from_opening_7_5_2 = "8" 14.trad_week_from_opening_7_5_2 = "9" 15.trad_week_from_opening_7_5_2 = "10" 16.trad_week_from_opening_7_5_2 = "11" 17.trad_week_from_opening_7_5_2 = "12" 18.trad_week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)


graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Cases - NE - 20 - 210419.gph"
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Cases - NE - 20 - 210419.jpg", as(jpg) name("Graph") quality(100)






**W***
*all ages*
*running it once and saving the estimates as hybrid
glm cases_per_pop_100K i.open1_mean_cat_all i.week_from_opening_7_5_2 i.hybrid_week_from_opening_7_5_2 i.trad_week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if region == 1 & week_from_opening_7_5_2 < 18, f(gamma) l(log) vce(cluster fips)

margins, dydx(hybrid_week_from_opening_7_5_2) post

estimates store hybrid_W_all

*running it again and saving the estimates as traditional (I had to take out the Google mobility data to get this to produce something for the margins)
glm cases_per_pop_100K i.open1_mean_cat_all i.week_from_opening_7_5_2 i.hybrid_week_from_opening_7_5_2 i.trad_week_from_opening_7_5_2      i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if region == 1 & week_from_opening_7_5_2 < 18, f(gamma) l(log) vce(cluster fips)

margins, dydx(trad_week_from_opening_7_5_2) post

estimates store trad_W_all

*plotting the coefficients
coefplot (hybrid_W_all, label(Hybrid) mlcolor(black) mcolor(gs12) ciopts(color(gs10)))   (trad_W_all, label(Traditional) mlcolor(black) mcolor(gs2) ciopts(color(gs2))), yline(0, lcolor(black) lpattern(dash)) vertical rename(1.hybrid_week_from_opening_7_5_2 = 1.trad_week_from_opening_7_5_2 2.hybrid_week_from_opening_7_5_2 = 2.trad_week_from_opening_7_5_2 3.hybrid_week_from_opening_7_5_2 = 3.trad_week_from_opening_7_5_2 4.hybrid_week_from_opening_7_5_2 = 4.trad_week_from_opening_7_5_2 5.hybrid_week_from_opening_7_5_2 = 5.trad_week_from_opening_7_5_2 6.hybrid_week_from_opening_7_5_2 = 6.trad_week_from_opening_7_5_2 7.hybrid_week_from_opening_7_5_2 = 7.trad_week_from_opening_7_5_2 8.hybrid_week_from_opening_7_5_2 = 8.trad_week_from_opening_7_5_2 9.hybrid_week_from_opening_7_5_2 = 9.trad_week_from_opening_7_5_2 10.hybrid_week_from_opening_7_5_2 = 10.trad_week_from_opening_7_5_2 11.hybrid_week_from_opening_7_5_2 = 11.trad_week_from_opening_7_5_2 12.hybrid_week_from_opening_7_5_2 = 12.trad_week_from_opening_7_5_2 13.hybrid_week_from_opening_7_5_2 = 13.trad_week_from_opening_7_5_2 14.hybrid_week_from_opening_7_5_2 = 14.trad_week_from_opening_7_5_2 15.hybrid_week_from_opening_7_5_2 = 15.trad_week_from_opening_7_5_2 16.hybrid_week_from_opening_7_5_2 = 16.trad_week_from_opening_7_5_2 17.hybrid_week_from_opening_7_5_2 = 17.trad_week_from_opening_7_5_2 18.hybrid_week_from_opening_7_5_2 = 18.trad_week_from_opening_7_5_2) coeflabels(1.trad_week_from_opening_7_5_2 = "-4" 2.trad_week_from_opening_7_5_2 = "-3" 3.trad_week_from_opening_7_5_2 = "-2" 4.trad_week_from_opening_7_5_2 = "-1" 5.trad_week_from_opening_7_5_2 = "0" 6.trad_week_from_opening_7_5_2 = "1" 7.trad_week_from_opening_7_5_2 = "2" 8.trad_week_from_opening_7_5_2 = "3" 9.trad_week_from_opening_7_5_2 = "4" 10.trad_week_from_opening_7_5_2 = "5" 11.trad_week_from_opening_7_5_2  = "6" 12.trad_week_from_opening_7_5_2 = "7" 13.trad_week_from_opening_7_5_2 = "8" 14.trad_week_from_opening_7_5_2 = "9" 15.trad_week_from_opening_7_5_2 = "10" 16.trad_week_from_opening_7_5_2 = "11" 17.trad_week_from_opening_7_5_2 = "12" 18.trad_week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)


graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Cases - W - All Ages - 210507.gph", replace
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Cases - W - All Ages - 210507.jpg", as(jpg) name("Graph") quality(100) replace




*0-9*
*running it once and saving the estimates as hybrid
glm cases_per_pop_0_9_100K i.open1_mean_cat_all i.week_from_opening_7_5_2 i.hybrid_week_from_opening_7_5_2 i.trad_week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if region == 1 & week_from_opening_7_5_2 < 18, f(gamma) l(log) vce(cluster fips)

margins, dydx(hybrid_week_from_opening_7_5_2) post

estimates store hybrid_W_0_9

*running it again and saving the estimates as traditional (I had to take out the Google mobility data to get this to produce something for the margins)
glm cases_per_pop_0_9_100K i.open1_mean_cat_all i.week_from_opening_7_5_2 i.hybrid_week_from_opening_7_5_2 i.trad_week_from_opening_7_5_2     i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if region == 1 & week_from_opening_7_5_2 < 18, f(gamma) l(log) vce(cluster fips)

margins, dydx(trad_week_from_opening_7_5_2) post

estimates store trad_W_0_9

*plotting the coefficients
coefplot (hybrid_W_0_9, label(Hybrid) mlcolor(black) mcolor(gs12) ciopts(color(gs10)))   (trad_W_0_9, label(Traditional) mlcolor(black) mcolor(gs2) ciopts(color(gs2))), yline(0, lcolor(black) lpattern(dash)) vertical rename(1.hybrid_week_from_opening_7_5_2 = 1.trad_week_from_opening_7_5_2 2.hybrid_week_from_opening_7_5_2 = 2.trad_week_from_opening_7_5_2 3.hybrid_week_from_opening_7_5_2 = 3.trad_week_from_opening_7_5_2 4.hybrid_week_from_opening_7_5_2 = 4.trad_week_from_opening_7_5_2 5.hybrid_week_from_opening_7_5_2 = 5.trad_week_from_opening_7_5_2 6.hybrid_week_from_opening_7_5_2 = 6.trad_week_from_opening_7_5_2 7.hybrid_week_from_opening_7_5_2 = 7.trad_week_from_opening_7_5_2 8.hybrid_week_from_opening_7_5_2 = 8.trad_week_from_opening_7_5_2 9.hybrid_week_from_opening_7_5_2 = 9.trad_week_from_opening_7_5_2 10.hybrid_week_from_opening_7_5_2 = 10.trad_week_from_opening_7_5_2 11.hybrid_week_from_opening_7_5_2 = 11.trad_week_from_opening_7_5_2 12.hybrid_week_from_opening_7_5_2 = 12.trad_week_from_opening_7_5_2 13.hybrid_week_from_opening_7_5_2 = 13.trad_week_from_opening_7_5_2 14.hybrid_week_from_opening_7_5_2 = 14.trad_week_from_opening_7_5_2 15.hybrid_week_from_opening_7_5_2 = 15.trad_week_from_opening_7_5_2 16.hybrid_week_from_opening_7_5_2 = 16.trad_week_from_opening_7_5_2 17.hybrid_week_from_opening_7_5_2 = 17.trad_week_from_opening_7_5_2 18.hybrid_week_from_opening_7_5_2 = 18.trad_week_from_opening_7_5_2) coeflabels(1.trad_week_from_opening_7_5_2 = "-4" 2.trad_week_from_opening_7_5_2 = "-3" 3.trad_week_from_opening_7_5_2 = "-2" 4.trad_week_from_opening_7_5_2 = "-1" 5.trad_week_from_opening_7_5_2 = "0" 6.trad_week_from_opening_7_5_2 = "1" 7.trad_week_from_opening_7_5_2 = "2" 8.trad_week_from_opening_7_5_2 = "3" 9.trad_week_from_opening_7_5_2 = "4" 10.trad_week_from_opening_7_5_2 = "5" 11.trad_week_from_opening_7_5_2  = "6" 12.trad_week_from_opening_7_5_2 = "7" 13.trad_week_from_opening_7_5_2 = "8" 14.trad_week_from_opening_7_5_2 = "9" 15.trad_week_from_opening_7_5_2 = "10" 16.trad_week_from_opening_7_5_2 = "11" 17.trad_week_from_opening_7_5_2 = "12" 18.trad_week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)


graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Cases - W - 0-9 - 210510.gph"
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Cases - W - 0-9 - 210510.jpg", as(jpg) name("Graph") quality(100)





*10-19*
*running it once and saving the estimates as hybrid
glm cases_per_pop_10_19_100K i.open1_mean_cat_all i.week_from_opening_7_5_2 i.hybrid_week_from_opening_7_5_2 i.trad_week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if region == 1 & week_from_opening_7_5_2 < 18, f(gamma) l(log) vce(cluster fips)

margins, dydx(hybrid_week_from_opening_7_5_2) post

estimates store hybrid_W_10_19

*running it again and saving the estimates as traditional (I had to take out the Google mobility data to get this to produce something for the margins)
glm cases_per_pop_10_19_100K i.open1_mean_cat_all i.week_from_opening_7_5_2 i.hybrid_week_from_opening_7_5_2 i.trad_week_from_opening_7_5_2     i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if region == 1 & week_from_opening_7_5_2 < 18, f(gamma) l(log) vce(cluster fips)

margins, dydx(trad_week_from_opening_7_5_2) post

estimates store trad_W_10_19

*plotting the coefficients
coefplot (hybrid_W_10_19, label(Hybrid) mlcolor(black) mcolor(gs12) ciopts(color(gs10)))   (trad_W_10_19, label(Traditional) mlcolor(black) mcolor(gs2) ciopts(color(gs2))), yline(0, lcolor(black) lpattern(dash)) vertical rename(1.hybrid_week_from_opening_7_5_2 = 1.trad_week_from_opening_7_5_2 2.hybrid_week_from_opening_7_5_2 = 2.trad_week_from_opening_7_5_2 3.hybrid_week_from_opening_7_5_2 = 3.trad_week_from_opening_7_5_2 4.hybrid_week_from_opening_7_5_2 = 4.trad_week_from_opening_7_5_2 5.hybrid_week_from_opening_7_5_2 = 5.trad_week_from_opening_7_5_2 6.hybrid_week_from_opening_7_5_2 = 6.trad_week_from_opening_7_5_2 7.hybrid_week_from_opening_7_5_2 = 7.trad_week_from_opening_7_5_2 8.hybrid_week_from_opening_7_5_2 = 8.trad_week_from_opening_7_5_2 9.hybrid_week_from_opening_7_5_2 = 9.trad_week_from_opening_7_5_2 10.hybrid_week_from_opening_7_5_2 = 10.trad_week_from_opening_7_5_2 11.hybrid_week_from_opening_7_5_2 = 11.trad_week_from_opening_7_5_2 12.hybrid_week_from_opening_7_5_2 = 12.trad_week_from_opening_7_5_2 13.hybrid_week_from_opening_7_5_2 = 13.trad_week_from_opening_7_5_2 14.hybrid_week_from_opening_7_5_2 = 14.trad_week_from_opening_7_5_2 15.hybrid_week_from_opening_7_5_2 = 15.trad_week_from_opening_7_5_2 16.hybrid_week_from_opening_7_5_2 = 16.trad_week_from_opening_7_5_2 17.hybrid_week_from_opening_7_5_2 = 17.trad_week_from_opening_7_5_2 18.hybrid_week_from_opening_7_5_2 = 18.trad_week_from_opening_7_5_2) coeflabels(1.trad_week_from_opening_7_5_2 = "-4" 2.trad_week_from_opening_7_5_2 = "-3" 3.trad_week_from_opening_7_5_2 = "-2" 4.trad_week_from_opening_7_5_2 = "-1" 5.trad_week_from_opening_7_5_2 = "0" 6.trad_week_from_opening_7_5_2 = "1" 7.trad_week_from_opening_7_5_2 = "2" 8.trad_week_from_opening_7_5_2 = "3" 9.trad_week_from_opening_7_5_2 = "4" 10.trad_week_from_opening_7_5_2 = "5" 11.trad_week_from_opening_7_5_2  = "6" 12.trad_week_from_opening_7_5_2 = "7" 13.trad_week_from_opening_7_5_2 = "8" 14.trad_week_from_opening_7_5_2 = "9" 15.trad_week_from_opening_7_5_2 = "10" 16.trad_week_from_opening_7_5_2 = "11" 17.trad_week_from_opening_7_5_2 = "12" 18.trad_week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)


graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Cases - W - 10-19 - 210510.gph"
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Cases - W - 10-19 - 210510.jpg", as(jpg) name("Graph") quality(100)





*20+*
*running it once and saving the estimates as hybrid
glm cases_per_pop_20_100K i.open1_mean_cat_all i.week_from_opening_7_5_2 i.hybrid_week_from_opening_7_5_2 i.trad_week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if region == 1 & week_from_opening_7_5_2 < 18, f(gamma) l(log) vce(cluster fips)

margins, dydx(hybrid_week_from_opening_7_5_2) post

estimates store hybrid_W_20

*running it again and saving the estimates as traditional (I had to take out the Google mobility data to get this to produce something for the margins)
glm cases_per_pop_20_100K i.open1_mean_cat_all i.week_from_opening_7_5_2 i.hybrid_week_from_opening_7_5_2 i.trad_week_from_opening_7_5_2     i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if region == 1 & week_from_opening_7_5_2 < 18, f(gamma) l(log) vce(cluster fips)

margins, dydx(trad_week_from_opening_7_5_2) post

estimates store trad_W_20

*plotting the coefficients
coefplot (hybrid_W_20, label(Hybrid) mlcolor(black) mcolor(gs12) ciopts(color(gs10)))   (trad_W_20, label(Traditional) mlcolor(black) mcolor(gs2) ciopts(color(gs2))), yline(0, lcolor(black) lpattern(dash)) vertical rename(1.hybrid_week_from_opening_7_5_2 = 1.trad_week_from_opening_7_5_2 2.hybrid_week_from_opening_7_5_2 = 2.trad_week_from_opening_7_5_2 3.hybrid_week_from_opening_7_5_2 = 3.trad_week_from_opening_7_5_2 4.hybrid_week_from_opening_7_5_2 = 4.trad_week_from_opening_7_5_2 5.hybrid_week_from_opening_7_5_2 = 5.trad_week_from_opening_7_5_2 6.hybrid_week_from_opening_7_5_2 = 6.trad_week_from_opening_7_5_2 7.hybrid_week_from_opening_7_5_2 = 7.trad_week_from_opening_7_5_2 8.hybrid_week_from_opening_7_5_2 = 8.trad_week_from_opening_7_5_2 9.hybrid_week_from_opening_7_5_2 = 9.trad_week_from_opening_7_5_2 10.hybrid_week_from_opening_7_5_2 = 10.trad_week_from_opening_7_5_2 11.hybrid_week_from_opening_7_5_2 = 11.trad_week_from_opening_7_5_2 12.hybrid_week_from_opening_7_5_2 = 12.trad_week_from_opening_7_5_2 13.hybrid_week_from_opening_7_5_2 = 13.trad_week_from_opening_7_5_2 14.hybrid_week_from_opening_7_5_2 = 14.trad_week_from_opening_7_5_2 15.hybrid_week_from_opening_7_5_2 = 15.trad_week_from_opening_7_5_2 16.hybrid_week_from_opening_7_5_2 = 16.trad_week_from_opening_7_5_2 17.hybrid_week_from_opening_7_5_2 = 17.trad_week_from_opening_7_5_2 18.hybrid_week_from_opening_7_5_2 = 18.trad_week_from_opening_7_5_2) coeflabels(1.trad_week_from_opening_7_5_2 = "-4" 2.trad_week_from_opening_7_5_2 = "-3" 3.trad_week_from_opening_7_5_2 = "-2" 4.trad_week_from_opening_7_5_2 = "-1" 5.trad_week_from_opening_7_5_2 = "0" 6.trad_week_from_opening_7_5_2 = "1" 7.trad_week_from_opening_7_5_2 = "2" 8.trad_week_from_opening_7_5_2 = "3" 9.trad_week_from_opening_7_5_2 = "4" 10.trad_week_from_opening_7_5_2 = "5" 11.trad_week_from_opening_7_5_2  = "6" 12.trad_week_from_opening_7_5_2 = "7" 13.trad_week_from_opening_7_5_2 = "8" 14.trad_week_from_opening_7_5_2 = "9" 15.trad_week_from_opening_7_5_2 = "10" 16.trad_week_from_opening_7_5_2 = "11" 17.trad_week_from_opening_7_5_2 = "12" 18.trad_week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)


graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Cases - W - 20 - 210510.gph"
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Cases - W - 20 - 210510.jpg", as(jpg) name("Graph") quality(100)






**MW***
*all ages*
*running it once and saving the estimates as hybrid
glm cases_per_pop_100K i.open1_mean_cat_all i.week_from_opening_7_5_2 i.hybrid_week_from_opening_7_5_2 i.trad_week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if region == 2 & week_from_opening_7_5_2 < 18, f(gamma) l(log) vce(cluster fips)

margins, dydx(hybrid_week_from_opening_7_5_2) post

estimates store hybrid_MW_all

*running it again and saving the estimates as traditional
glm cases_per_pop_100K i.open1_mean_cat_all i.week_from_opening_7_5_2 i.hybrid_week_from_opening_7_5_2 i.trad_week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if region == 2 & week_from_opening_7_5_2 < 18, f(gamma) l(log) vce(cluster fips)

margins, dydx(trad_week_from_opening_7_5_2) post

estimates store trad_MW_all

*plotting the coefficients
coefplot (hybrid_MW_all, label(Hybrid) mlcolor(black) mcolor(gs12) ciopts(color(gs10)))   (trad_MW_all, label(Traditional) mlcolor(black) mcolor(gs2) ciopts(color(gs2))), yline(0, lcolor(black) lpattern(dash)) vertical rename(1.hybrid_week_from_opening_7_5_2 = 1.trad_week_from_opening_7_5_2 2.hybrid_week_from_opening_7_5_2 = 2.trad_week_from_opening_7_5_2 3.hybrid_week_from_opening_7_5_2 = 3.trad_week_from_opening_7_5_2 4.hybrid_week_from_opening_7_5_2 = 4.trad_week_from_opening_7_5_2 5.hybrid_week_from_opening_7_5_2 = 5.trad_week_from_opening_7_5_2 6.hybrid_week_from_opening_7_5_2 = 6.trad_week_from_opening_7_5_2 7.hybrid_week_from_opening_7_5_2 = 7.trad_week_from_opening_7_5_2 8.hybrid_week_from_opening_7_5_2 = 8.trad_week_from_opening_7_5_2 9.hybrid_week_from_opening_7_5_2 = 9.trad_week_from_opening_7_5_2 10.hybrid_week_from_opening_7_5_2 = 10.trad_week_from_opening_7_5_2 11.hybrid_week_from_opening_7_5_2 = 11.trad_week_from_opening_7_5_2 12.hybrid_week_from_opening_7_5_2 = 12.trad_week_from_opening_7_5_2 13.hybrid_week_from_opening_7_5_2 = 13.trad_week_from_opening_7_5_2 14.hybrid_week_from_opening_7_5_2 = 14.trad_week_from_opening_7_5_2 15.hybrid_week_from_opening_7_5_2 = 15.trad_week_from_opening_7_5_2 16.hybrid_week_from_opening_7_5_2 = 16.trad_week_from_opening_7_5_2 17.hybrid_week_from_opening_7_5_2 = 17.trad_week_from_opening_7_5_2 18.hybrid_week_from_opening_7_5_2 = 18.trad_week_from_opening_7_5_2) coeflabels(1.trad_week_from_opening_7_5_2 = "-4" 2.trad_week_from_opening_7_5_2 = "-3" 3.trad_week_from_opening_7_5_2 = "-2" 4.trad_week_from_opening_7_5_2 = "-1" 5.trad_week_from_opening_7_5_2 = "0" 6.trad_week_from_opening_7_5_2 = "1" 7.trad_week_from_opening_7_5_2 = "2" 8.trad_week_from_opening_7_5_2 = "3" 9.trad_week_from_opening_7_5_2 = "4" 10.trad_week_from_opening_7_5_2 = "5" 11.trad_week_from_opening_7_5_2  = "6" 12.trad_week_from_opening_7_5_2 = "7" 13.trad_week_from_opening_7_5_2 = "8" 14.trad_week_from_opening_7_5_2 = "9" 15.trad_week_from_opening_7_5_2 = "10" 16.trad_week_from_opening_7_5_2 = "11" 17.trad_week_from_opening_7_5_2 = "12" 18.trad_week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)


graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Cases - MW - All Ages - 210507.gph"
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Cases - MW - All Ages - 210507.jpg", as(jpg) name("Graph") quality(100)





*0-9*
*running it once and saving the estimates as hybrid
glm cases_per_pop_0_9_100K i.open1_mean_cat_all i.week_from_opening_7_5_2 i.hybrid_week_from_opening_7_5_2 i.trad_week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if region == 2 & week_from_opening_7_5_2 < 18, f(gamma) l(log) vce(cluster fips)

margins, dydx(hybrid_week_from_opening_7_5_2) post

estimates store hybrid_MW_0_9

*running it again and saving the estimates as traditional
glm cases_per_pop_0_9_100K i.open1_mean_cat_all i.week_from_opening_7_5_2 i.hybrid_week_from_opening_7_5_2 i.trad_week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if region == 2 & week_from_opening_7_5_2 < 18, f(gamma) l(log) vce(cluster fips)

margins, dydx(trad_week_from_opening_7_5_2) post

estimates store trad_MW_0_9

*plotting the coefficients
coefplot (hybrid_MW_0_9, label(Hybrid) mlcolor(black) mcolor(gs12) ciopts(color(gs10)))   (trad_MW_0_9, label(Traditional) mlcolor(black) mcolor(gs2) ciopts(color(gs2))), yline(0, lcolor(black) lpattern(dash)) vertical rename(1.hybrid_week_from_opening_7_5_2 = 1.trad_week_from_opening_7_5_2 2.hybrid_week_from_opening_7_5_2 = 2.trad_week_from_opening_7_5_2 3.hybrid_week_from_opening_7_5_2 = 3.trad_week_from_opening_7_5_2 4.hybrid_week_from_opening_7_5_2 = 4.trad_week_from_opening_7_5_2 5.hybrid_week_from_opening_7_5_2 = 5.trad_week_from_opening_7_5_2 6.hybrid_week_from_opening_7_5_2 = 6.trad_week_from_opening_7_5_2 7.hybrid_week_from_opening_7_5_2 = 7.trad_week_from_opening_7_5_2 8.hybrid_week_from_opening_7_5_2 = 8.trad_week_from_opening_7_5_2 9.hybrid_week_from_opening_7_5_2 = 9.trad_week_from_opening_7_5_2 10.hybrid_week_from_opening_7_5_2 = 10.trad_week_from_opening_7_5_2 11.hybrid_week_from_opening_7_5_2 = 11.trad_week_from_opening_7_5_2 12.hybrid_week_from_opening_7_5_2 = 12.trad_week_from_opening_7_5_2 13.hybrid_week_from_opening_7_5_2 = 13.trad_week_from_opening_7_5_2 14.hybrid_week_from_opening_7_5_2 = 14.trad_week_from_opening_7_5_2 15.hybrid_week_from_opening_7_5_2 = 15.trad_week_from_opening_7_5_2 16.hybrid_week_from_opening_7_5_2 = 16.trad_week_from_opening_7_5_2 17.hybrid_week_from_opening_7_5_2 = 17.trad_week_from_opening_7_5_2 18.hybrid_week_from_opening_7_5_2 = 18.trad_week_from_opening_7_5_2) coeflabels(1.trad_week_from_opening_7_5_2 = "-4" 2.trad_week_from_opening_7_5_2 = "-3" 3.trad_week_from_opening_7_5_2 = "-2" 4.trad_week_from_opening_7_5_2 = "-1" 5.trad_week_from_opening_7_5_2 = "0" 6.trad_week_from_opening_7_5_2 = "1" 7.trad_week_from_opening_7_5_2 = "2" 8.trad_week_from_opening_7_5_2 = "3" 9.trad_week_from_opening_7_5_2 = "4" 10.trad_week_from_opening_7_5_2 = "5" 11.trad_week_from_opening_7_5_2  = "6" 12.trad_week_from_opening_7_5_2 = "7" 13.trad_week_from_opening_7_5_2 = "8" 14.trad_week_from_opening_7_5_2 = "9" 15.trad_week_from_opening_7_5_2 = "10" 16.trad_week_from_opening_7_5_2 = "11" 17.trad_week_from_opening_7_5_2 = "12" 18.trad_week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)


graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Cases - MW - 0-9 - 210510.gph"
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Cases - MW - 0-9 - 210510.jpg", as(jpg) name("Graph") quality(100)





*10-19*
*running it once and saving the estimates as hybrid
glm cases_per_pop_10_19_100K i.open1_mean_cat_all i.week_from_opening_7_5_2 i.hybrid_week_from_opening_7_5_2 i.trad_week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if region == 2 & week_from_opening_7_5_2 < 18, f(gamma) l(log) vce(cluster fips)

margins, dydx(hybrid_week_from_opening_7_5_2) post

estimates store hybrid_MW_10_19

*running it again and saving the estimates as traditional
glm cases_per_pop_10_19_100K i.open1_mean_cat_all i.week_from_opening_7_5_2 i.hybrid_week_from_opening_7_5_2 i.trad_week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if region == 2 & week_from_opening_7_5_2 < 18, f(gamma) l(log) vce(cluster fips)

margins, dydx(trad_week_from_opening_7_5_2) post

estimates store trad_MW_10_19

*plotting the coefficients
coefplot (hybrid_MW_10_19, label(Hybrid) mlcolor(black) mcolor(gs12) ciopts(color(gs10)))   (trad_MW_10_19, label(Traditional) mlcolor(black) mcolor(gs2) ciopts(color(gs2))), yline(0, lcolor(black) lpattern(dash)) vertical rename(1.hybrid_week_from_opening_7_5_2 = 1.trad_week_from_opening_7_5_2 2.hybrid_week_from_opening_7_5_2 = 2.trad_week_from_opening_7_5_2 3.hybrid_week_from_opening_7_5_2 = 3.trad_week_from_opening_7_5_2 4.hybrid_week_from_opening_7_5_2 = 4.trad_week_from_opening_7_5_2 5.hybrid_week_from_opening_7_5_2 = 5.trad_week_from_opening_7_5_2 6.hybrid_week_from_opening_7_5_2 = 6.trad_week_from_opening_7_5_2 7.hybrid_week_from_opening_7_5_2 = 7.trad_week_from_opening_7_5_2 8.hybrid_week_from_opening_7_5_2 = 8.trad_week_from_opening_7_5_2 9.hybrid_week_from_opening_7_5_2 = 9.trad_week_from_opening_7_5_2 10.hybrid_week_from_opening_7_5_2 = 10.trad_week_from_opening_7_5_2 11.hybrid_week_from_opening_7_5_2 = 11.trad_week_from_opening_7_5_2 12.hybrid_week_from_opening_7_5_2 = 12.trad_week_from_opening_7_5_2 13.hybrid_week_from_opening_7_5_2 = 13.trad_week_from_opening_7_5_2 14.hybrid_week_from_opening_7_5_2 = 14.trad_week_from_opening_7_5_2 15.hybrid_week_from_opening_7_5_2 = 15.trad_week_from_opening_7_5_2 16.hybrid_week_from_opening_7_5_2 = 16.trad_week_from_opening_7_5_2 17.hybrid_week_from_opening_7_5_2 = 17.trad_week_from_opening_7_5_2 18.hybrid_week_from_opening_7_5_2 = 18.trad_week_from_opening_7_5_2) coeflabels(1.trad_week_from_opening_7_5_2 = "-4" 2.trad_week_from_opening_7_5_2 = "-3" 3.trad_week_from_opening_7_5_2 = "-2" 4.trad_week_from_opening_7_5_2 = "-1" 5.trad_week_from_opening_7_5_2 = "0" 6.trad_week_from_opening_7_5_2 = "1" 7.trad_week_from_opening_7_5_2 = "2" 8.trad_week_from_opening_7_5_2 = "3" 9.trad_week_from_opening_7_5_2 = "4" 10.trad_week_from_opening_7_5_2 = "5" 11.trad_week_from_opening_7_5_2  = "6" 12.trad_week_from_opening_7_5_2 = "7" 13.trad_week_from_opening_7_5_2 = "8" 14.trad_week_from_opening_7_5_2 = "9" 15.trad_week_from_opening_7_5_2 = "10" 16.trad_week_from_opening_7_5_2 = "11" 17.trad_week_from_opening_7_5_2 = "12" 18.trad_week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)


graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Cases - MW - 10-19 - 210510.gph"
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Cases - MW - 10-19 - 210510.jpg", as(jpg) name("Graph") quality(100)





*20+*
*running it once and saving the estimates as hybrid
glm cases_per_pop_20_100K i.open1_mean_cat_all i.week_from_opening_7_5_2 i.hybrid_week_from_opening_7_5_2 i.trad_week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if region == 2 & week_from_opening_7_5_2 < 18, f(gamma) l(log) vce(cluster fips)

margins, dydx(hybrid_week_from_opening_7_5_2) post

estimates store hybrid_MW_20

*running it again and saving the estimates as traditional
glm cases_per_pop_20_100K i.open1_mean_cat_all i.week_from_opening_7_5_2 i.hybrid_week_from_opening_7_5_2 i.trad_week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if region == 2 & week_from_opening_7_5_2 < 18, f(gamma) l(log) vce(cluster fips)

margins, dydx(trad_week_from_opening_7_5_2) post

estimates store trad_MW_20

*plotting the coefficients
coefplot (hybrid_MW_20, label(Hybrid) mlcolor(black) mcolor(gs12) ciopts(color(gs10)))   (trad_MW_20, label(Traditional) mlcolor(black) mcolor(gs2) ciopts(color(gs2))), yline(0, lcolor(black) lpattern(dash)) vertical rename(1.hybrid_week_from_opening_7_5_2 = 1.trad_week_from_opening_7_5_2 2.hybrid_week_from_opening_7_5_2 = 2.trad_week_from_opening_7_5_2 3.hybrid_week_from_opening_7_5_2 = 3.trad_week_from_opening_7_5_2 4.hybrid_week_from_opening_7_5_2 = 4.trad_week_from_opening_7_5_2 5.hybrid_week_from_opening_7_5_2 = 5.trad_week_from_opening_7_5_2 6.hybrid_week_from_opening_7_5_2 = 6.trad_week_from_opening_7_5_2 7.hybrid_week_from_opening_7_5_2 = 7.trad_week_from_opening_7_5_2 8.hybrid_week_from_opening_7_5_2 = 8.trad_week_from_opening_7_5_2 9.hybrid_week_from_opening_7_5_2 = 9.trad_week_from_opening_7_5_2 10.hybrid_week_from_opening_7_5_2 = 10.trad_week_from_opening_7_5_2 11.hybrid_week_from_opening_7_5_2 = 11.trad_week_from_opening_7_5_2 12.hybrid_week_from_opening_7_5_2 = 12.trad_week_from_opening_7_5_2 13.hybrid_week_from_opening_7_5_2 = 13.trad_week_from_opening_7_5_2 14.hybrid_week_from_opening_7_5_2 = 14.trad_week_from_opening_7_5_2 15.hybrid_week_from_opening_7_5_2 = 15.trad_week_from_opening_7_5_2 16.hybrid_week_from_opening_7_5_2 = 16.trad_week_from_opening_7_5_2 17.hybrid_week_from_opening_7_5_2 = 17.trad_week_from_opening_7_5_2 18.hybrid_week_from_opening_7_5_2 = 18.trad_week_from_opening_7_5_2) coeflabels(1.trad_week_from_opening_7_5_2 = "-4" 2.trad_week_from_opening_7_5_2 = "-3" 3.trad_week_from_opening_7_5_2 = "-2" 4.trad_week_from_opening_7_5_2 = "-1" 5.trad_week_from_opening_7_5_2 = "0" 6.trad_week_from_opening_7_5_2 = "1" 7.trad_week_from_opening_7_5_2 = "2" 8.trad_week_from_opening_7_5_2 = "3" 9.trad_week_from_opening_7_5_2 = "4" 10.trad_week_from_opening_7_5_2 = "5" 11.trad_week_from_opening_7_5_2  = "6" 12.trad_week_from_opening_7_5_2 = "7" 13.trad_week_from_opening_7_5_2 = "8" 14.trad_week_from_opening_7_5_2 = "9" 15.trad_week_from_opening_7_5_2 = "10" 16.trad_week_from_opening_7_5_2 = "11" 17.trad_week_from_opening_7_5_2 = "12" 18.trad_week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)


graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Cases - MW - 20 - 210510.gph"
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Cases - MW - 20 - 210510.jpg", as(jpg) name("Graph") quality(100)







**S***
*all ages*
*running it once and saving the estimates as hybrid
glm cases_per_pop_100K i.open1_mean_cat_all i.week_from_opening_7_5_2 i.hybrid_week_from_opening_7_5_2 i.trad_week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if region == 3 & week_from_opening_7_5_2 < 18, f(gamma) l(log) vce(cluster fips)

margins, dydx(hybrid_week_from_opening_7_5_2) post

estimates store hybrid_S_all

*running it again and saving the estimates as traditional
glm cases_per_pop_100K i.open1_mean_cat_all i.week_from_opening_7_5_2 i.hybrid_week_from_opening_7_5_2 i.trad_week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if region == 3 & week_from_opening_7_5_2 < 18, f(gamma) l(log) vce(cluster fips)

margins, dydx(trad_week_from_opening_7_5_2) post

estimates store trad_S_all

*plotting the coefficients
coefplot (hybrid_S_all, label(Hybrid) mlcolor(black) mcolor(gs12) ciopts(color(gs10)))   (trad_S_all, label(Traditional) mlcolor(black) mcolor(gs2) ciopts(color(gs2))), yline(0, lcolor(black) lpattern(dash)) vertical rename(1.hybrid_week_from_opening_7_5_2 = 1.trad_week_from_opening_7_5_2 2.hybrid_week_from_opening_7_5_2 = 2.trad_week_from_opening_7_5_2 3.hybrid_week_from_opening_7_5_2 = 3.trad_week_from_opening_7_5_2 4.hybrid_week_from_opening_7_5_2 = 4.trad_week_from_opening_7_5_2 5.hybrid_week_from_opening_7_5_2 = 5.trad_week_from_opening_7_5_2 6.hybrid_week_from_opening_7_5_2 = 6.trad_week_from_opening_7_5_2 7.hybrid_week_from_opening_7_5_2 = 7.trad_week_from_opening_7_5_2 8.hybrid_week_from_opening_7_5_2 = 8.trad_week_from_opening_7_5_2 9.hybrid_week_from_opening_7_5_2 = 9.trad_week_from_opening_7_5_2 10.hybrid_week_from_opening_7_5_2 = 10.trad_week_from_opening_7_5_2 11.hybrid_week_from_opening_7_5_2 = 11.trad_week_from_opening_7_5_2 12.hybrid_week_from_opening_7_5_2 = 12.trad_week_from_opening_7_5_2 13.hybrid_week_from_opening_7_5_2 = 13.trad_week_from_opening_7_5_2 14.hybrid_week_from_opening_7_5_2 = 14.trad_week_from_opening_7_5_2 15.hybrid_week_from_opening_7_5_2 = 15.trad_week_from_opening_7_5_2 16.hybrid_week_from_opening_7_5_2 = 16.trad_week_from_opening_7_5_2 17.hybrid_week_from_opening_7_5_2 = 17.trad_week_from_opening_7_5_2 18.hybrid_week_from_opening_7_5_2 = 18.trad_week_from_opening_7_5_2) coeflabels(1.trad_week_from_opening_7_5_2 = "-4" 2.trad_week_from_opening_7_5_2 = "-3" 3.trad_week_from_opening_7_5_2 = "-2" 4.trad_week_from_opening_7_5_2 = "-1" 5.trad_week_from_opening_7_5_2 = "0" 6.trad_week_from_opening_7_5_2 = "1" 7.trad_week_from_opening_7_5_2 = "2" 8.trad_week_from_opening_7_5_2 = "3" 9.trad_week_from_opening_7_5_2 = "4" 10.trad_week_from_opening_7_5_2 = "5" 11.trad_week_from_opening_7_5_2  = "6" 12.trad_week_from_opening_7_5_2 = "7" 13.trad_week_from_opening_7_5_2 = "8" 14.trad_week_from_opening_7_5_2 = "9" 15.trad_week_from_opening_7_5_2 = "10" 16.trad_week_from_opening_7_5_2 = "11" 17.trad_week_from_opening_7_5_2 = "12" 18.trad_week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)


graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Cases - S - All Ages - 210507.gph"
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Cases - S - All Ages - 210507.jpg", as(jpg) name("Graph") quality(100)






*0-9*
*running it once and saving the estimates as hybrid
glm cases_per_pop_0_9_100K i.open1_mean_cat_all i.week_from_opening_7_5_2 i.hybrid_week_from_opening_7_5_2 i.trad_week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if region == 3 & week_from_opening_7_5_2 < 18, f(gamma) l(log) vce(cluster fips)

margins, dydx(hybrid_week_from_opening_7_5_2) post

estimates store hybrid_S_0_9

*running it again and saving the estimates as traditional
glm cases_per_pop_0_9_100K i.open1_mean_cat_all i.week_from_opening_7_5_2 i.hybrid_week_from_opening_7_5_2 i.trad_week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if region == 3 & week_from_opening_7_5_2 < 18, f(gamma) l(log) vce(cluster fips)

margins, dydx(trad_week_from_opening_7_5_2) post

estimates store trad_S_0_9

*plotting the coefficients
coefplot (hybrid_S_0_9, label(Hybrid) mlcolor(black) mcolor(gs12) ciopts(color(gs10)))   (trad_S_0_9, label(Traditional) mlcolor(black) mcolor(gs2) ciopts(color(gs2))), yline(0, lcolor(black) lpattern(dash)) vertical rename(1.hybrid_week_from_opening_7_5_2 = 1.trad_week_from_opening_7_5_2 2.hybrid_week_from_opening_7_5_2 = 2.trad_week_from_opening_7_5_2 3.hybrid_week_from_opening_7_5_2 = 3.trad_week_from_opening_7_5_2 4.hybrid_week_from_opening_7_5_2 = 4.trad_week_from_opening_7_5_2 5.hybrid_week_from_opening_7_5_2 = 5.trad_week_from_opening_7_5_2 6.hybrid_week_from_opening_7_5_2 = 6.trad_week_from_opening_7_5_2 7.hybrid_week_from_opening_7_5_2 = 7.trad_week_from_opening_7_5_2 8.hybrid_week_from_opening_7_5_2 = 8.trad_week_from_opening_7_5_2 9.hybrid_week_from_opening_7_5_2 = 9.trad_week_from_opening_7_5_2 10.hybrid_week_from_opening_7_5_2 = 10.trad_week_from_opening_7_5_2 11.hybrid_week_from_opening_7_5_2 = 11.trad_week_from_opening_7_5_2 12.hybrid_week_from_opening_7_5_2 = 12.trad_week_from_opening_7_5_2 13.hybrid_week_from_opening_7_5_2 = 13.trad_week_from_opening_7_5_2 14.hybrid_week_from_opening_7_5_2 = 14.trad_week_from_opening_7_5_2 15.hybrid_week_from_opening_7_5_2 = 15.trad_week_from_opening_7_5_2 16.hybrid_week_from_opening_7_5_2 = 16.trad_week_from_opening_7_5_2 17.hybrid_week_from_opening_7_5_2 = 17.trad_week_from_opening_7_5_2 18.hybrid_week_from_opening_7_5_2 = 18.trad_week_from_opening_7_5_2) coeflabels(1.trad_week_from_opening_7_5_2 = "-4" 2.trad_week_from_opening_7_5_2 = "-3" 3.trad_week_from_opening_7_5_2 = "-2" 4.trad_week_from_opening_7_5_2 = "-1" 5.trad_week_from_opening_7_5_2 = "0" 6.trad_week_from_opening_7_5_2 = "1" 7.trad_week_from_opening_7_5_2 = "2" 8.trad_week_from_opening_7_5_2 = "3" 9.trad_week_from_opening_7_5_2 = "4" 10.trad_week_from_opening_7_5_2 = "5" 11.trad_week_from_opening_7_5_2  = "6" 12.trad_week_from_opening_7_5_2 = "7" 13.trad_week_from_opening_7_5_2 = "8" 14.trad_week_from_opening_7_5_2 = "9" 15.trad_week_from_opening_7_5_2 = "10" 16.trad_week_from_opening_7_5_2 = "11" 17.trad_week_from_opening_7_5_2 = "12" 18.trad_week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)


graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Cases - S - 0-9 - 210510.gph"
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Cases - S - 0-9 - 210510.jpg", as(jpg) name("Graph") quality(100)





*10-19*
*running it once and saving the estimates as hybrid
glm cases_per_pop_10_19_100K i.open1_mean_cat_all i.week_from_opening_7_5_2 i.hybrid_week_from_opening_7_5_2 i.trad_week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if region == 3 & week_from_opening_7_5_2 < 18, f(gamma) l(log) vce(cluster fips)

margins, dydx(hybrid_week_from_opening_7_5_2) post

estimates store hybrid_S_10_19

*running it again and saving the estimates as traditional
glm cases_per_pop_10_19_100K i.open1_mean_cat_all i.week_from_opening_7_5_2 i.hybrid_week_from_opening_7_5_2 i.trad_week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if region == 3 & week_from_opening_7_5_2 < 18, f(gamma) l(log) vce(cluster fips)

margins, dydx(trad_week_from_opening_7_5_2) post

estimates store trad_S_10_19

*plotting the coefficients
coefplot (hybrid_S_10_19, label(Hybrid) mlcolor(black) mcolor(gs12) ciopts(color(gs10)))   (trad_S_10_19, label(Traditional) mlcolor(black) mcolor(gs2) ciopts(color(gs2))), yline(0, lcolor(black) lpattern(dash)) vertical rename(1.hybrid_week_from_opening_7_5_2 = 1.trad_week_from_opening_7_5_2 2.hybrid_week_from_opening_7_5_2 = 2.trad_week_from_opening_7_5_2 3.hybrid_week_from_opening_7_5_2 = 3.trad_week_from_opening_7_5_2 4.hybrid_week_from_opening_7_5_2 = 4.trad_week_from_opening_7_5_2 5.hybrid_week_from_opening_7_5_2 = 5.trad_week_from_opening_7_5_2 6.hybrid_week_from_opening_7_5_2 = 6.trad_week_from_opening_7_5_2 7.hybrid_week_from_opening_7_5_2 = 7.trad_week_from_opening_7_5_2 8.hybrid_week_from_opening_7_5_2 = 8.trad_week_from_opening_7_5_2 9.hybrid_week_from_opening_7_5_2 = 9.trad_week_from_opening_7_5_2 10.hybrid_week_from_opening_7_5_2 = 10.trad_week_from_opening_7_5_2 11.hybrid_week_from_opening_7_5_2 = 11.trad_week_from_opening_7_5_2 12.hybrid_week_from_opening_7_5_2 = 12.trad_week_from_opening_7_5_2 13.hybrid_week_from_opening_7_5_2 = 13.trad_week_from_opening_7_5_2 14.hybrid_week_from_opening_7_5_2 = 14.trad_week_from_opening_7_5_2 15.hybrid_week_from_opening_7_5_2 = 15.trad_week_from_opening_7_5_2 16.hybrid_week_from_opening_7_5_2 = 16.trad_week_from_opening_7_5_2 17.hybrid_week_from_opening_7_5_2 = 17.trad_week_from_opening_7_5_2 18.hybrid_week_from_opening_7_5_2 = 18.trad_week_from_opening_7_5_2) coeflabels(1.trad_week_from_opening_7_5_2 = "-4" 2.trad_week_from_opening_7_5_2 = "-3" 3.trad_week_from_opening_7_5_2 = "-2" 4.trad_week_from_opening_7_5_2 = "-1" 5.trad_week_from_opening_7_5_2 = "0" 6.trad_week_from_opening_7_5_2 = "1" 7.trad_week_from_opening_7_5_2 = "2" 8.trad_week_from_opening_7_5_2 = "3" 9.trad_week_from_opening_7_5_2 = "4" 10.trad_week_from_opening_7_5_2 = "5" 11.trad_week_from_opening_7_5_2  = "6" 12.trad_week_from_opening_7_5_2 = "7" 13.trad_week_from_opening_7_5_2 = "8" 14.trad_week_from_opening_7_5_2 = "9" 15.trad_week_from_opening_7_5_2 = "10" 16.trad_week_from_opening_7_5_2 = "11" 17.trad_week_from_opening_7_5_2 = "12" 18.trad_week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)


graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Cases - S - 10-19 - 210510.gph"
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Cases - S - 10-19 - 210510.jpg", as(jpg) name("Graph") quality(100)





*20+*
*running it once and saving the estimates as hybrid
glm cases_per_pop_20_100K i.open1_mean_cat_all i.week_from_opening_7_5_2 i.hybrid_week_from_opening_7_5_2 i.trad_week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if region == 3 & week_from_opening_7_5_2 < 18, f(gamma) l(log) vce(cluster fips)

margins, dydx(hybrid_week_from_opening_7_5_2) post

estimates store hybrid_S_20

*running it again and saving the estimates as traditional
glm cases_per_pop_20_100K i.open1_mean_cat_all i.week_from_opening_7_5_2 i.hybrid_week_from_opening_7_5_2 i.trad_week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if region == 3 & week_from_opening_7_5_2 < 18, f(gamma) l(log) vce(cluster fips)

margins, dydx(trad_week_from_opening_7_5_2) post

estimates store trad_S_20

*plotting the coefficients
coefplot (hybrid_S_20, label(Hybrid) mlcolor(black) mcolor(gs12) ciopts(color(gs10)))   (trad_S_20, label(Traditional) mlcolor(black) mcolor(gs2) ciopts(color(gs2))), yline(0, lcolor(black) lpattern(dash)) vertical rename(1.hybrid_week_from_opening_7_5_2 = 1.trad_week_from_opening_7_5_2 2.hybrid_week_from_opening_7_5_2 = 2.trad_week_from_opening_7_5_2 3.hybrid_week_from_opening_7_5_2 = 3.trad_week_from_opening_7_5_2 4.hybrid_week_from_opening_7_5_2 = 4.trad_week_from_opening_7_5_2 5.hybrid_week_from_opening_7_5_2 = 5.trad_week_from_opening_7_5_2 6.hybrid_week_from_opening_7_5_2 = 6.trad_week_from_opening_7_5_2 7.hybrid_week_from_opening_7_5_2 = 7.trad_week_from_opening_7_5_2 8.hybrid_week_from_opening_7_5_2 = 8.trad_week_from_opening_7_5_2 9.hybrid_week_from_opening_7_5_2 = 9.trad_week_from_opening_7_5_2 10.hybrid_week_from_opening_7_5_2 = 10.trad_week_from_opening_7_5_2 11.hybrid_week_from_opening_7_5_2 = 11.trad_week_from_opening_7_5_2 12.hybrid_week_from_opening_7_5_2 = 12.trad_week_from_opening_7_5_2 13.hybrid_week_from_opening_7_5_2 = 13.trad_week_from_opening_7_5_2 14.hybrid_week_from_opening_7_5_2 = 14.trad_week_from_opening_7_5_2 15.hybrid_week_from_opening_7_5_2 = 15.trad_week_from_opening_7_5_2 16.hybrid_week_from_opening_7_5_2 = 16.trad_week_from_opening_7_5_2 17.hybrid_week_from_opening_7_5_2 = 17.trad_week_from_opening_7_5_2 18.hybrid_week_from_opening_7_5_2 = 18.trad_week_from_opening_7_5_2) coeflabels(1.trad_week_from_opening_7_5_2 = "-4" 2.trad_week_from_opening_7_5_2 = "-3" 3.trad_week_from_opening_7_5_2 = "-2" 4.trad_week_from_opening_7_5_2 = "-1" 5.trad_week_from_opening_7_5_2 = "0" 6.trad_week_from_opening_7_5_2 = "1" 7.trad_week_from_opening_7_5_2 = "2" 8.trad_week_from_opening_7_5_2 = "3" 9.trad_week_from_opening_7_5_2 = "4" 10.trad_week_from_opening_7_5_2 = "5" 11.trad_week_from_opening_7_5_2  = "6" 12.trad_week_from_opening_7_5_2 = "7" 13.trad_week_from_opening_7_5_2 = "8" 14.trad_week_from_opening_7_5_2 = "9" 15.trad_week_from_opening_7_5_2 = "10" 16.trad_week_from_opening_7_5_2 = "11" 17.trad_week_from_opening_7_5_2 = "12" 18.trad_week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)


graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Cases - S - 20 - 210510.gph"
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Cases - S - 20 - 210510.jpg", as(jpg) name("Graph") quality(100)







***COVID DEATHS****
**Whole Country***
*all ages* 
*running it once and saving the estimates as hybrid 
glm deaths_per_pop_100K i.open1_mean_cat_all i.week_from_opening_7_5_2 i.hybrid_week_from_opening_7_5_2 i.trad_week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips , f(poisson) l(log) vce(cluster fips) iterate(10)

margins, dydx(hybrid_week_from_opening_7_5_2) post

estimates store deaths_hybrid_all_all

*running it again and saving the estimates as traditional
glm deaths_per_pop_100K i.open1_mean_cat_all i.week_from_opening_7_5_2 i.hybrid_week_from_opening_7_5_2 i.trad_week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips , f(poisson) l(log) vce(cluster fips) iterate(10)

margins, dydx(trad_week_from_opening_7_5_2) post

estimates store deaths_trad_all_all

*plotting the coefficients
coefplot (deaths_hybrid_all_all, label(Hybrid) mlcolor(black) mcolor(gs12) ciopts(color(gs10)))   (deaths_trad_all_all, label(Traditional) mlcolor(black) mcolor(gs2) ciopts(color(gs2))), yline(0, lcolor(black) lpattern(dash)) vertical rename(1.hybrid_week_from_opening_7_5_2 = 1.trad_week_from_opening_7_5_2 2.hybrid_week_from_opening_7_5_2 = 2.trad_week_from_opening_7_5_2 3.hybrid_week_from_opening_7_5_2 = 3.trad_week_from_opening_7_5_2 4.hybrid_week_from_opening_7_5_2 = 4.trad_week_from_opening_7_5_2 5.hybrid_week_from_opening_7_5_2 = 5.trad_week_from_opening_7_5_2 6.hybrid_week_from_opening_7_5_2 = 6.trad_week_from_opening_7_5_2 7.hybrid_week_from_opening_7_5_2 = 7.trad_week_from_opening_7_5_2 8.hybrid_week_from_opening_7_5_2 = 8.trad_week_from_opening_7_5_2 9.hybrid_week_from_opening_7_5_2 = 9.trad_week_from_opening_7_5_2 10.hybrid_week_from_opening_7_5_2 = 10.trad_week_from_opening_7_5_2 11.hybrid_week_from_opening_7_5_2 = 11.trad_week_from_opening_7_5_2 12.hybrid_week_from_opening_7_5_2 = 12.trad_week_from_opening_7_5_2 13.hybrid_week_from_opening_7_5_2 = 13.trad_week_from_opening_7_5_2 14.hybrid_week_from_opening_7_5_2 = 14.trad_week_from_opening_7_5_2 15.hybrid_week_from_opening_7_5_2 = 15.trad_week_from_opening_7_5_2 16.hybrid_week_from_opening_7_5_2 = 16.trad_week_from_opening_7_5_2 17.hybrid_week_from_opening_7_5_2 = 17.trad_week_from_opening_7_5_2 18.hybrid_week_from_opening_7_5_2 = 18.trad_week_from_opening_7_5_2) coeflabels(1.trad_week_from_opening_7_5_2 = "-4" 2.trad_week_from_opening_7_5_2 = "-3" 3.trad_week_from_opening_7_5_2 = "-2" 4.trad_week_from_opening_7_5_2 = "-1" 5.trad_week_from_opening_7_5_2 = "0" 6.trad_week_from_opening_7_5_2 = "1" 7.trad_week_from_opening_7_5_2 = "2" 8.trad_week_from_opening_7_5_2 = "3" 9.trad_week_from_opening_7_5_2 = "4" 10.trad_week_from_opening_7_5_2 = "5" 11.trad_week_from_opening_7_5_2  = "6" 12.trad_week_from_opening_7_5_2 = "7" 13.trad_week_from_opening_7_5_2 = "8" 14.trad_week_from_opening_7_5_2 = "9" 15.trad_week_from_opening_7_5_2 = "10" 16.trad_week_from_opening_7_5_2 = "11" 17.trad_week_from_opening_7_5_2 = "12" 18.trad_week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)


graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Deaths - Whole Country - All Ages - 210420_2300.gph", replace
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Deaths - Whole Country - All Ages - 210420_2300.jpg", as(jpg) name("Graph") quality(100) replace




*ages 0-9*
*running it once and saving the estimates as hybrid
glm cases_per_pop_0_9_100K i.open1_mean_cat_all i.week_from_opening_7_5_2 i.hybrid_week_from_opening_7_5_2 i.trad_week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips, f(gamma) l(log) vce(cluster fips)

margins, dydx(hybrid_week_from_opening_7_5_2) post

estimates store hybrid_all_0_9

*running it again and saving the estimates as traditional
glm cases_per_pop_0_9_100K i.open1_mean_cat_all i.week_from_opening_7_5_2 i.hybrid_week_from_opening_7_5_2 i.trad_week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips, f(gamma) l(log) vce(cluster fips)

margins, dydx(trad_week_from_opening_7_5_2) post

estimates store trad_all_0_9

*plotting the coefficients
coefplot (hybrid_all_0_9, label(Hybrid) mlcolor(black) mcolor(gs12) ciopts(color(gs10)))   (trad_all_0_9, label(Traditional) mlcolor(black) mcolor(gs2) ciopts(color(gs2))), yline(0, lcolor(black) lpattern(dash)) vertical rename(1.hybrid_week_from_opening_7_5_2 = 1.trad_week_from_opening_7_5_2 2.hybrid_week_from_opening_7_5_2 = 2.trad_week_from_opening_7_5_2 3.hybrid_week_from_opening_7_5_2 = 3.trad_week_from_opening_7_5_2 4.hybrid_week_from_opening_7_5_2 = 4.trad_week_from_opening_7_5_2 5.hybrid_week_from_opening_7_5_2 = 5.trad_week_from_opening_7_5_2 6.hybrid_week_from_opening_7_5_2 = 6.trad_week_from_opening_7_5_2 7.hybrid_week_from_opening_7_5_2 = 7.trad_week_from_opening_7_5_2 8.hybrid_week_from_opening_7_5_2 = 8.trad_week_from_opening_7_5_2 9.hybrid_week_from_opening_7_5_2 = 9.trad_week_from_opening_7_5_2 10.hybrid_week_from_opening_7_5_2 = 10.trad_week_from_opening_7_5_2 11.hybrid_week_from_opening_7_5_2 = 11.trad_week_from_opening_7_5_2 12.hybrid_week_from_opening_7_5_2 = 12.trad_week_from_opening_7_5_2 13.hybrid_week_from_opening_7_5_2 = 13.trad_week_from_opening_7_5_2 14.hybrid_week_from_opening_7_5_2 = 14.trad_week_from_opening_7_5_2 15.hybrid_week_from_opening_7_5_2 = 15.trad_week_from_opening_7_5_2 16.hybrid_week_from_opening_7_5_2 = 16.trad_week_from_opening_7_5_2 17.hybrid_week_from_opening_7_5_2 = 17.trad_week_from_opening_7_5_2 18.hybrid_week_from_opening_7_5_2 = 18.trad_week_from_opening_7_5_2) coeflabels(1.trad_week_from_opening_7_5_2 = "-4" 2.trad_week_from_opening_7_5_2 = "-3" 3.trad_week_from_opening_7_5_2 = "-2" 4.trad_week_from_opening_7_5_2 = "-1" 5.trad_week_from_opening_7_5_2 = "0" 6.trad_week_from_opening_7_5_2 = "1" 7.trad_week_from_opening_7_5_2 = "2" 8.trad_week_from_opening_7_5_2 = "3" 9.trad_week_from_opening_7_5_2 = "4" 10.trad_week_from_opening_7_5_2 = "5" 11.trad_week_from_opening_7_5_2  = "6" 12.trad_week_from_opening_7_5_2 = "7" 13.trad_week_from_opening_7_5_2 = "8" 14.trad_week_from_opening_7_5_2 = "9" 15.trad_week_from_opening_7_5_2 = "10" 16.trad_week_from_opening_7_5_2 = "11" 17.trad_week_from_opening_7_5_2 = "12" 18.trad_week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)


graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Cases - Whole Country - 0-9 - 210419.gph"
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Cases - Whole Country - 0-9 - 210419.jpg", as(jpg) name("Graph") quality(100)




*ages 10-19*
*running it once and saving the estimates as hybrid
glm cases_per_pop_10_19_100K i.open1_mean_cat_all i.week_from_opening_7_5_2 i.hybrid_week_from_opening_7_5_2 i.trad_week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips, f(gamma) l(log) vce(cluster fips)

margins, dydx(hybrid_week_from_opening_7_5_2) post

estimates store hybrid_all_10_19

*running it again and saving the estimates as traditional
glm cases_per_pop_10_19_100K i.open1_mean_cat_all i.week_from_opening_7_5_2 i.hybrid_week_from_opening_7_5_2 i.trad_week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips, f(gamma) l(log) vce(cluster fips)

margins, dydx(trad_week_from_opening_7_5_2) post

estimates store trad_all_10_19

*plotting the coefficients
coefplot (hybrid_all_10_19, label(Hybrid) mlcolor(black) mcolor(gs12) ciopts(color(gs10)))   (trad_all_10_19, label(Traditional) mlcolor(black) mcolor(gs2) ciopts(color(gs2))), yline(0, lcolor(black) lpattern(dash)) vertical rename(1.hybrid_week_from_opening_7_5_2 = 1.trad_week_from_opening_7_5_2 2.hybrid_week_from_opening_7_5_2 = 2.trad_week_from_opening_7_5_2 3.hybrid_week_from_opening_7_5_2 = 3.trad_week_from_opening_7_5_2 4.hybrid_week_from_opening_7_5_2 = 4.trad_week_from_opening_7_5_2 5.hybrid_week_from_opening_7_5_2 = 5.trad_week_from_opening_7_5_2 6.hybrid_week_from_opening_7_5_2 = 6.trad_week_from_opening_7_5_2 7.hybrid_week_from_opening_7_5_2 = 7.trad_week_from_opening_7_5_2 8.hybrid_week_from_opening_7_5_2 = 8.trad_week_from_opening_7_5_2 9.hybrid_week_from_opening_7_5_2 = 9.trad_week_from_opening_7_5_2 10.hybrid_week_from_opening_7_5_2 = 10.trad_week_from_opening_7_5_2 11.hybrid_week_from_opening_7_5_2 = 11.trad_week_from_opening_7_5_2 12.hybrid_week_from_opening_7_5_2 = 12.trad_week_from_opening_7_5_2 13.hybrid_week_from_opening_7_5_2 = 13.trad_week_from_opening_7_5_2 14.hybrid_week_from_opening_7_5_2 = 14.trad_week_from_opening_7_5_2 15.hybrid_week_from_opening_7_5_2 = 15.trad_week_from_opening_7_5_2 16.hybrid_week_from_opening_7_5_2 = 16.trad_week_from_opening_7_5_2 17.hybrid_week_from_opening_7_5_2 = 17.trad_week_from_opening_7_5_2 18.hybrid_week_from_opening_7_5_2 = 18.trad_week_from_opening_7_5_2) coeflabels(1.trad_week_from_opening_7_5_2 = "-4" 2.trad_week_from_opening_7_5_2 = "-3" 3.trad_week_from_opening_7_5_2 = "-2" 4.trad_week_from_opening_7_5_2 = "-1" 5.trad_week_from_opening_7_5_2 = "0" 6.trad_week_from_opening_7_5_2 = "1" 7.trad_week_from_opening_7_5_2 = "2" 8.trad_week_from_opening_7_5_2 = "3" 9.trad_week_from_opening_7_5_2 = "4" 10.trad_week_from_opening_7_5_2 = "5" 11.trad_week_from_opening_7_5_2  = "6" 12.trad_week_from_opening_7_5_2 = "7" 13.trad_week_from_opening_7_5_2 = "8" 14.trad_week_from_opening_7_5_2 = "9" 15.trad_week_from_opening_7_5_2 = "10" 16.trad_week_from_opening_7_5_2 = "11" 17.trad_week_from_opening_7_5_2 = "12" 18.trad_week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)


graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Cases - Whole Country - 10-19 - 210419.gph"
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Cases - Whole Country - 10-19 - 210419.jpg", as(jpg) name("Graph") quality(100)





*ages 20+*
*running it once and saving the estimates as hybrid
glm cases_per_pop_20_100K i.open1_mean_cat_all i.week_from_opening_7_5_2 i.hybrid_week_from_opening_7_5_2 i.trad_week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips, f(gamma) l(log) vce(cluster fips)

margins, dydx(hybrid_week_from_opening_7_5_2) post

estimates store hybrid_all_20

*running it again and saving the estimates as traditional
glm cases_per_pop_20_100K i.open1_mean_cat_all i.week_from_opening_7_5_2 i.hybrid_week_from_opening_7_5_2 i.trad_week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips, f(gamma) l(log) vce(cluster fips)

margins, dydx(trad_week_from_opening_7_5_2) post

estimates store trad_all_20

*plotting the coefficients
coefplot (hybrid_all_20, label(Hybrid) mlcolor(black) mcolor(gs12) ciopts(color(gs10)))   (trad_all_20, label(Traditional) mlcolor(black) mcolor(gs2) ciopts(color(gs2))), yline(0, lcolor(black) lpattern(dash)) vertical rename(1.hybrid_week_from_opening_7_5_2 = 1.trad_week_from_opening_7_5_2 2.hybrid_week_from_opening_7_5_2 = 2.trad_week_from_opening_7_5_2 3.hybrid_week_from_opening_7_5_2 = 3.trad_week_from_opening_7_5_2 4.hybrid_week_from_opening_7_5_2 = 4.trad_week_from_opening_7_5_2 5.hybrid_week_from_opening_7_5_2 = 5.trad_week_from_opening_7_5_2 6.hybrid_week_from_opening_7_5_2 = 6.trad_week_from_opening_7_5_2 7.hybrid_week_from_opening_7_5_2 = 7.trad_week_from_opening_7_5_2 8.hybrid_week_from_opening_7_5_2 = 8.trad_week_from_opening_7_5_2 9.hybrid_week_from_opening_7_5_2 = 9.trad_week_from_opening_7_5_2 10.hybrid_week_from_opening_7_5_2 = 10.trad_week_from_opening_7_5_2 11.hybrid_week_from_opening_7_5_2 = 11.trad_week_from_opening_7_5_2 12.hybrid_week_from_opening_7_5_2 = 12.trad_week_from_opening_7_5_2 13.hybrid_week_from_opening_7_5_2 = 13.trad_week_from_opening_7_5_2 14.hybrid_week_from_opening_7_5_2 = 14.trad_week_from_opening_7_5_2 15.hybrid_week_from_opening_7_5_2 = 15.trad_week_from_opening_7_5_2 16.hybrid_week_from_opening_7_5_2 = 16.trad_week_from_opening_7_5_2 17.hybrid_week_from_opening_7_5_2 = 17.trad_week_from_opening_7_5_2 18.hybrid_week_from_opening_7_5_2 = 18.trad_week_from_opening_7_5_2) coeflabels(1.trad_week_from_opening_7_5_2 = "-4" 2.trad_week_from_opening_7_5_2 = "-3" 3.trad_week_from_opening_7_5_2 = "-2" 4.trad_week_from_opening_7_5_2 = "-1" 5.trad_week_from_opening_7_5_2 = "0" 6.trad_week_from_opening_7_5_2 = "1" 7.trad_week_from_opening_7_5_2 = "2" 8.trad_week_from_opening_7_5_2 = "3" 9.trad_week_from_opening_7_5_2 = "4" 10.trad_week_from_opening_7_5_2 = "5" 11.trad_week_from_opening_7_5_2  = "6" 12.trad_week_from_opening_7_5_2 = "7" 13.trad_week_from_opening_7_5_2 = "8" 14.trad_week_from_opening_7_5_2 = "9" 15.trad_week_from_opening_7_5_2 = "10" 16.trad_week_from_opening_7_5_2 = "11" 17.trad_week_from_opening_7_5_2 = "12" 18.trad_week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)


graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Cases - Whole Country - 20+ - 210419.gph"
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Cases - Whole Country - 20+ - 210419.jpg", as(jpg) name("Graph") quality(100)




**NE***
*all ages (I had to drop the state*week interactions and county FE so that the margins results would be interpretable)
*running it once and saving the estimates as hybrid
glm deaths_per_pop_100K i.open1_mean_cat_all i.week_from_opening_7_5_2 i.hybrid_week_from_opening_7_5_2 i.trad_week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips  if region == 0, f(poisson) l(log) vce(cluster fips) iterate(10)

margins, dydx(hybrid_week_from_opening_7_5_2) post

estimates store deaths_hybrid_NE_all

*running it again and saving the estimates as traditional
glm deaths_per_pop_100K i.open1_mean_cat_all i.week_from_opening_7_5_2 i.hybrid_week_from_opening_7_5_2 i.trad_week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips  if region == 0, f(poisson) l(log) vce(cluster fips) iterate(10)

margins, dydx(trad_week_from_opening_7_5_2) post

estimates store deaths_trad_NE_all

*plotting the coefficients
coefplot (deaths_hybrid_NE_all, label(Hybrid) mlcolor(black) mcolor(gs12) ciopts(color(gs10)))   (deaths_trad_NE_all, label(Traditional) mlcolor(black) mcolor(gs2) ciopts(color(gs2))), yline(0, lcolor(black) lpattern(dash)) vertical rename(1.hybrid_week_from_opening_7_5_2 = 1.trad_week_from_opening_7_5_2 2.hybrid_week_from_opening_7_5_2 = 2.trad_week_from_opening_7_5_2 3.hybrid_week_from_opening_7_5_2 = 3.trad_week_from_opening_7_5_2 4.hybrid_week_from_opening_7_5_2 = 4.trad_week_from_opening_7_5_2 5.hybrid_week_from_opening_7_5_2 = 5.trad_week_from_opening_7_5_2 6.hybrid_week_from_opening_7_5_2 = 6.trad_week_from_opening_7_5_2 7.hybrid_week_from_opening_7_5_2 = 7.trad_week_from_opening_7_5_2 8.hybrid_week_from_opening_7_5_2 = 8.trad_week_from_opening_7_5_2 9.hybrid_week_from_opening_7_5_2 = 9.trad_week_from_opening_7_5_2 10.hybrid_week_from_opening_7_5_2 = 10.trad_week_from_opening_7_5_2 11.hybrid_week_from_opening_7_5_2 = 11.trad_week_from_opening_7_5_2 12.hybrid_week_from_opening_7_5_2 = 12.trad_week_from_opening_7_5_2 13.hybrid_week_from_opening_7_5_2 = 13.trad_week_from_opening_7_5_2 14.hybrid_week_from_opening_7_5_2 = 14.trad_week_from_opening_7_5_2 15.hybrid_week_from_opening_7_5_2 = 15.trad_week_from_opening_7_5_2 16.hybrid_week_from_opening_7_5_2 = 16.trad_week_from_opening_7_5_2 17.hybrid_week_from_opening_7_5_2 = 17.trad_week_from_opening_7_5_2 18.hybrid_week_from_opening_7_5_2 = 18.trad_week_from_opening_7_5_2) coeflabels(1.trad_week_from_opening_7_5_2 = "-4" 2.trad_week_from_opening_7_5_2 = "-3" 3.trad_week_from_opening_7_5_2 = "-2" 4.trad_week_from_opening_7_5_2 = "-1" 5.trad_week_from_opening_7_5_2 = "0" 6.trad_week_from_opening_7_5_2 = "1" 7.trad_week_from_opening_7_5_2 = "2" 8.trad_week_from_opening_7_5_2 = "3" 9.trad_week_from_opening_7_5_2 = "4" 10.trad_week_from_opening_7_5_2 = "5" 11.trad_week_from_opening_7_5_2  = "6" 12.trad_week_from_opening_7_5_2 = "7" 13.trad_week_from_opening_7_5_2 = "8" 14.trad_week_from_opening_7_5_2 = "9" 15.trad_week_from_opening_7_5_2 = "10" 16.trad_week_from_opening_7_5_2 = "11" 17.trad_week_from_opening_7_5_2 = "12" 18.trad_week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)


graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Deaths - NE - All Ages - 210420.gph", replace
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Deaths - NE - All Ages - 210420.jpg", as(jpg) name("Graph") quality(100) replace



*0-9*
*running it once and saving the estimates as hybrid
glm cases_per_pop_0_9_100K i.open1_mean_cat_all i.week_from_opening_7_5_2 i.hybrid_week_from_opening_7_5_2 i.trad_week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if region == 0, f(gamma) l(log) vce(cluster fips)

margins, dydx(hybrid_week_from_opening_7_5_2) post

estimates store hybrid_NE_0_9

*running it again and saving the estimates as traditional
glm cases_per_pop_0_9_100K i.open1_mean_cat_all i.week_from_opening_7_5_2 i.hybrid_week_from_opening_7_5_2 i.trad_week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if region == 0, f(gamma) l(log) vce(cluster fips)

margins, dydx(trad_week_from_opening_7_5_2) post

estimates store trad_NE_0_9

*plotting the coefficients
coefplot (hybrid_NE_0_9, label(Hybrid) mlcolor(black) mcolor(gs12) ciopts(color(gs10)))   (trad_NE_0_9, label(Traditional) mlcolor(black) mcolor(gs2) ciopts(color(gs2))), yline(0, lcolor(black) lpattern(dash)) vertical rename(1.hybrid_week_from_opening_7_5_2 = 1.trad_week_from_opening_7_5_2 2.hybrid_week_from_opening_7_5_2 = 2.trad_week_from_opening_7_5_2 3.hybrid_week_from_opening_7_5_2 = 3.trad_week_from_opening_7_5_2 4.hybrid_week_from_opening_7_5_2 = 4.trad_week_from_opening_7_5_2 5.hybrid_week_from_opening_7_5_2 = 5.trad_week_from_opening_7_5_2 6.hybrid_week_from_opening_7_5_2 = 6.trad_week_from_opening_7_5_2 7.hybrid_week_from_opening_7_5_2 = 7.trad_week_from_opening_7_5_2 8.hybrid_week_from_opening_7_5_2 = 8.trad_week_from_opening_7_5_2 9.hybrid_week_from_opening_7_5_2 = 9.trad_week_from_opening_7_5_2 10.hybrid_week_from_opening_7_5_2 = 10.trad_week_from_opening_7_5_2 11.hybrid_week_from_opening_7_5_2 = 11.trad_week_from_opening_7_5_2 12.hybrid_week_from_opening_7_5_2 = 12.trad_week_from_opening_7_5_2 13.hybrid_week_from_opening_7_5_2 = 13.trad_week_from_opening_7_5_2 14.hybrid_week_from_opening_7_5_2 = 14.trad_week_from_opening_7_5_2 15.hybrid_week_from_opening_7_5_2 = 15.trad_week_from_opening_7_5_2 16.hybrid_week_from_opening_7_5_2 = 16.trad_week_from_opening_7_5_2 17.hybrid_week_from_opening_7_5_2 = 17.trad_week_from_opening_7_5_2 18.hybrid_week_from_opening_7_5_2 = 18.trad_week_from_opening_7_5_2) coeflabels(1.trad_week_from_opening_7_5_2 = "-4" 2.trad_week_from_opening_7_5_2 = "-3" 3.trad_week_from_opening_7_5_2 = "-2" 4.trad_week_from_opening_7_5_2 = "-1" 5.trad_week_from_opening_7_5_2 = "0" 6.trad_week_from_opening_7_5_2 = "1" 7.trad_week_from_opening_7_5_2 = "2" 8.trad_week_from_opening_7_5_2 = "3" 9.trad_week_from_opening_7_5_2 = "4" 10.trad_week_from_opening_7_5_2 = "5" 11.trad_week_from_opening_7_5_2  = "6" 12.trad_week_from_opening_7_5_2 = "7" 13.trad_week_from_opening_7_5_2 = "8" 14.trad_week_from_opening_7_5_2 = "9" 15.trad_week_from_opening_7_5_2 = "10" 16.trad_week_from_opening_7_5_2 = "11" 17.trad_week_from_opening_7_5_2 = "12" 18.trad_week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)


graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Cases - NE - 0-9 - 210419.gph"
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Cases - NE - 0-9 - 210419.jpg", as(jpg) name("Graph") quality(100)





*10-19*
*running it once and saving the estimates as hybrid
glm cases_per_pop_10_19_100K i.open1_mean_cat_all i.week_from_opening_7_5_2 i.hybrid_week_from_opening_7_5_2 i.trad_week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if region == 0, f(gamma) l(log) vce(cluster fips)

margins, dydx(hybrid_week_from_opening_7_5_2) post

estimates store hybrid_NE_10_19

*running it again and saving the estimates as traditional
glm cases_per_pop_10_19_100K i.open1_mean_cat_all i.week_from_opening_7_5_2 i.hybrid_week_from_opening_7_5_2 i.trad_week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if region == 0, f(gamma) l(log) vce(cluster fips)

margins, dydx(trad_week_from_opening_7_5_2) post

estimates store trad_NE_10_19

*plotting the coefficients
coefplot (hybrid_NE_10_19, label(Hybrid) mlcolor(black) mcolor(gs12) ciopts(color(gs10)))   (trad_NE_10_19, label(Traditional) mlcolor(black) mcolor(gs2) ciopts(color(gs2))), yline(0, lcolor(black) lpattern(dash)) vertical rename(1.hybrid_week_from_opening_7_5_2 = 1.trad_week_from_opening_7_5_2 2.hybrid_week_from_opening_7_5_2 = 2.trad_week_from_opening_7_5_2 3.hybrid_week_from_opening_7_5_2 = 3.trad_week_from_opening_7_5_2 4.hybrid_week_from_opening_7_5_2 = 4.trad_week_from_opening_7_5_2 5.hybrid_week_from_opening_7_5_2 = 5.trad_week_from_opening_7_5_2 6.hybrid_week_from_opening_7_5_2 = 6.trad_week_from_opening_7_5_2 7.hybrid_week_from_opening_7_5_2 = 7.trad_week_from_opening_7_5_2 8.hybrid_week_from_opening_7_5_2 = 8.trad_week_from_opening_7_5_2 9.hybrid_week_from_opening_7_5_2 = 9.trad_week_from_opening_7_5_2 10.hybrid_week_from_opening_7_5_2 = 10.trad_week_from_opening_7_5_2 11.hybrid_week_from_opening_7_5_2 = 11.trad_week_from_opening_7_5_2 12.hybrid_week_from_opening_7_5_2 = 12.trad_week_from_opening_7_5_2 13.hybrid_week_from_opening_7_5_2 = 13.trad_week_from_opening_7_5_2 14.hybrid_week_from_opening_7_5_2 = 14.trad_week_from_opening_7_5_2 15.hybrid_week_from_opening_7_5_2 = 15.trad_week_from_opening_7_5_2 16.hybrid_week_from_opening_7_5_2 = 16.trad_week_from_opening_7_5_2 17.hybrid_week_from_opening_7_5_2 = 17.trad_week_from_opening_7_5_2 18.hybrid_week_from_opening_7_5_2 = 18.trad_week_from_opening_7_5_2) coeflabels(1.trad_week_from_opening_7_5_2 = "-4" 2.trad_week_from_opening_7_5_2 = "-3" 3.trad_week_from_opening_7_5_2 = "-2" 4.trad_week_from_opening_7_5_2 = "-1" 5.trad_week_from_opening_7_5_2 = "0" 6.trad_week_from_opening_7_5_2 = "1" 7.trad_week_from_opening_7_5_2 = "2" 8.trad_week_from_opening_7_5_2 = "3" 9.trad_week_from_opening_7_5_2 = "4" 10.trad_week_from_opening_7_5_2 = "5" 11.trad_week_from_opening_7_5_2  = "6" 12.trad_week_from_opening_7_5_2 = "7" 13.trad_week_from_opening_7_5_2 = "8" 14.trad_week_from_opening_7_5_2 = "9" 15.trad_week_from_opening_7_5_2 = "10" 16.trad_week_from_opening_7_5_2 = "11" 17.trad_week_from_opening_7_5_2 = "12" 18.trad_week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)


graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Cases - NE - 10-19 - 210419.gph"
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Cases - NE - 10-19 - 210419.jpg", as(jpg) name("Graph") quality(100)





*20+*
*running it once and saving the estimates as hybrid
glm cases_per_pop_20_100K i.open1_mean_cat_all i.week_from_opening_7_5_2 i.hybrid_week_from_opening_7_5_2 i.trad_week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if region == 0, f(gamma) l(log) vce(cluster fips)

margins, dydx(hybrid_week_from_opening_7_5_2) post

estimates store hybrid_NE_20

*running it again and saving the estimates as traditional
glm cases_per_pop_20_100K i.open1_mean_cat_all i.week_from_opening_7_5_2 i.hybrid_week_from_opening_7_5_2 i.trad_week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if region == 0, f(gamma) l(log) vce(cluster fips)

margins, dydx(trad_week_from_opening_7_5_2) post

estimates store trad_NE_20

*plotting the coefficients
coefplot (hybrid_NE_20, label(Hybrid) mlcolor(black) mcolor(gs12) ciopts(color(gs10)))   (trad_NE_20, label(Traditional) mlcolor(black) mcolor(gs2) ciopts(color(gs2))), yline(0, lcolor(black) lpattern(dash)) vertical rename(1.hybrid_week_from_opening_7_5_2 = 1.trad_week_from_opening_7_5_2 2.hybrid_week_from_opening_7_5_2 = 2.trad_week_from_opening_7_5_2 3.hybrid_week_from_opening_7_5_2 = 3.trad_week_from_opening_7_5_2 4.hybrid_week_from_opening_7_5_2 = 4.trad_week_from_opening_7_5_2 5.hybrid_week_from_opening_7_5_2 = 5.trad_week_from_opening_7_5_2 6.hybrid_week_from_opening_7_5_2 = 6.trad_week_from_opening_7_5_2 7.hybrid_week_from_opening_7_5_2 = 7.trad_week_from_opening_7_5_2 8.hybrid_week_from_opening_7_5_2 = 8.trad_week_from_opening_7_5_2 9.hybrid_week_from_opening_7_5_2 = 9.trad_week_from_opening_7_5_2 10.hybrid_week_from_opening_7_5_2 = 10.trad_week_from_opening_7_5_2 11.hybrid_week_from_opening_7_5_2 = 11.trad_week_from_opening_7_5_2 12.hybrid_week_from_opening_7_5_2 = 12.trad_week_from_opening_7_5_2 13.hybrid_week_from_opening_7_5_2 = 13.trad_week_from_opening_7_5_2 14.hybrid_week_from_opening_7_5_2 = 14.trad_week_from_opening_7_5_2 15.hybrid_week_from_opening_7_5_2 = 15.trad_week_from_opening_7_5_2 16.hybrid_week_from_opening_7_5_2 = 16.trad_week_from_opening_7_5_2 17.hybrid_week_from_opening_7_5_2 = 17.trad_week_from_opening_7_5_2 18.hybrid_week_from_opening_7_5_2 = 18.trad_week_from_opening_7_5_2) coeflabels(1.trad_week_from_opening_7_5_2 = "-4" 2.trad_week_from_opening_7_5_2 = "-3" 3.trad_week_from_opening_7_5_2 = "-2" 4.trad_week_from_opening_7_5_2 = "-1" 5.trad_week_from_opening_7_5_2 = "0" 6.trad_week_from_opening_7_5_2 = "1" 7.trad_week_from_opening_7_5_2 = "2" 8.trad_week_from_opening_7_5_2 = "3" 9.trad_week_from_opening_7_5_2 = "4" 10.trad_week_from_opening_7_5_2 = "5" 11.trad_week_from_opening_7_5_2  = "6" 12.trad_week_from_opening_7_5_2 = "7" 13.trad_week_from_opening_7_5_2 = "8" 14.trad_week_from_opening_7_5_2 = "9" 15.trad_week_from_opening_7_5_2 = "10" 16.trad_week_from_opening_7_5_2 = "11" 17.trad_week_from_opening_7_5_2 = "12" 18.trad_week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)


graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Cases - NE - 20 - 210419.gph"
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Cases - NE - 20 - 210419.jpg", as(jpg) name("Graph") quality(100)






**W***
*all ages* (i had to take out the state*week interaction so the margins results would be interpretable)
*running it once and saving the estimates as hybrid
glm deaths_per_pop_100K i.open1_mean_cat_all i.week_from_opening_7_5_2 i.hybrid_week_from_opening_7_5_2 i.trad_week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips  if region == 1 & week_from_opening_7_5_2 < 18, f(poisson) l(log) vce(cluster fips) iterate(10)

margins, dydx(hybrid_week_from_opening_7_5_2) post

estimates store deaths_hybrid_W_all

*running it again and saving the estimates as traditional
glm deaths_per_pop_100K i.open1_mean_cat_all i.week_from_opening_7_5_2 i.hybrid_week_from_opening_7_5_2 i.trad_week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips  if region == 1 & week_from_opening_7_5_2 < 18, f(poisson) l(log) vce(cluster fips) iterate(10)

margins, dydx(trad_week_from_opening_7_5_2) post

estimates store deaths_trad_W_all

*plotting the coefficients
coefplot (deaths_hybrid_W_all, label(Hybrid) mlcolor(black) mcolor(gs12) ciopts(color(gs10)))   (deaths_trad_W_all, label(Traditional) mlcolor(black) mcolor(gs2) ciopts(color(gs2))), yline(0, lcolor(black) lpattern(dash)) vertical rename(1.hybrid_week_from_opening_7_5_2 = 1.trad_week_from_opening_7_5_2 2.hybrid_week_from_opening_7_5_2 = 2.trad_week_from_opening_7_5_2 3.hybrid_week_from_opening_7_5_2 = 3.trad_week_from_opening_7_5_2 4.hybrid_week_from_opening_7_5_2 = 4.trad_week_from_opening_7_5_2 5.hybrid_week_from_opening_7_5_2 = 5.trad_week_from_opening_7_5_2 6.hybrid_week_from_opening_7_5_2 = 6.trad_week_from_opening_7_5_2 7.hybrid_week_from_opening_7_5_2 = 7.trad_week_from_opening_7_5_2 8.hybrid_week_from_opening_7_5_2 = 8.trad_week_from_opening_7_5_2 9.hybrid_week_from_opening_7_5_2 = 9.trad_week_from_opening_7_5_2 10.hybrid_week_from_opening_7_5_2 = 10.trad_week_from_opening_7_5_2 11.hybrid_week_from_opening_7_5_2 = 11.trad_week_from_opening_7_5_2 12.hybrid_week_from_opening_7_5_2 = 12.trad_week_from_opening_7_5_2 13.hybrid_week_from_opening_7_5_2 = 13.trad_week_from_opening_7_5_2 14.hybrid_week_from_opening_7_5_2 = 14.trad_week_from_opening_7_5_2 15.hybrid_week_from_opening_7_5_2 = 15.trad_week_from_opening_7_5_2 16.hybrid_week_from_opening_7_5_2 = 16.trad_week_from_opening_7_5_2 17.hybrid_week_from_opening_7_5_2 = 17.trad_week_from_opening_7_5_2 18.hybrid_week_from_opening_7_5_2 = 18.trad_week_from_opening_7_5_2) coeflabels(1.trad_week_from_opening_7_5_2 = "-4" 2.trad_week_from_opening_7_5_2 = "-3" 3.trad_week_from_opening_7_5_2 = "-2" 4.trad_week_from_opening_7_5_2 = "-1" 5.trad_week_from_opening_7_5_2 = "0" 6.trad_week_from_opening_7_5_2 = "1" 7.trad_week_from_opening_7_5_2 = "2" 8.trad_week_from_opening_7_5_2 = "3" 9.trad_week_from_opening_7_5_2 = "4" 10.trad_week_from_opening_7_5_2 = "5" 11.trad_week_from_opening_7_5_2  = "6" 12.trad_week_from_opening_7_5_2 = "7" 13.trad_week_from_opening_7_5_2 = "8" 14.trad_week_from_opening_7_5_2 = "9" 15.trad_week_from_opening_7_5_2 = "10" 16.trad_week_from_opening_7_5_2 = "11" 17.trad_week_from_opening_7_5_2 = "12" 18.trad_week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)


graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Deaths - W - All Ages - 210510.gph", replace
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Deaths - W - All Ages - 210510.jpg", as(jpg) name("Graph") quality(100) replace



*0-9*
*running it once and saving the estimates as hybrid
glm cases_per_pop_0_9_100K i.open1_mean_cat_all i.week_from_opening_7_5_2 i.hybrid_week_from_opening_7_5_2 i.trad_week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if region == 1, f(gamma) l(log) vce(cluster fips)

margins, dydx(hybrid_week_from_opening_7_5_2) post

estimates store hybrid_W_0_9

*running it again and saving the estimates as traditional (I had to take out the Google mobility data to get this to produce something for the margins)
glm cases_per_pop_0_9_100K i.open1_mean_cat_all i.week_from_opening_7_5_2 i.hybrid_week_from_opening_7_5_2 i.trad_week_from_opening_7_5_2     i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if region == 1, f(gamma) l(log) vce(cluster fips)

margins, dydx(trad_week_from_opening_7_5_2) post

estimates store trad_W_0_9

*plotting the coefficients
coefplot (hybrid_W_0_9, label(Hybrid) mlcolor(black) mcolor(gs12) ciopts(color(gs10)))   (trad_W_0_9, label(Traditional) mlcolor(black) mcolor(gs2) ciopts(color(gs2))), yline(0, lcolor(black) lpattern(dash)) vertical rename(1.hybrid_week_from_opening_7_5_2 = 1.trad_week_from_opening_7_5_2 2.hybrid_week_from_opening_7_5_2 = 2.trad_week_from_opening_7_5_2 3.hybrid_week_from_opening_7_5_2 = 3.trad_week_from_opening_7_5_2 4.hybrid_week_from_opening_7_5_2 = 4.trad_week_from_opening_7_5_2 5.hybrid_week_from_opening_7_5_2 = 5.trad_week_from_opening_7_5_2 6.hybrid_week_from_opening_7_5_2 = 6.trad_week_from_opening_7_5_2 7.hybrid_week_from_opening_7_5_2 = 7.trad_week_from_opening_7_5_2 8.hybrid_week_from_opening_7_5_2 = 8.trad_week_from_opening_7_5_2 9.hybrid_week_from_opening_7_5_2 = 9.trad_week_from_opening_7_5_2 10.hybrid_week_from_opening_7_5_2 = 10.trad_week_from_opening_7_5_2 11.hybrid_week_from_opening_7_5_2 = 11.trad_week_from_opening_7_5_2 12.hybrid_week_from_opening_7_5_2 = 12.trad_week_from_opening_7_5_2 13.hybrid_week_from_opening_7_5_2 = 13.trad_week_from_opening_7_5_2 14.hybrid_week_from_opening_7_5_2 = 14.trad_week_from_opening_7_5_2 15.hybrid_week_from_opening_7_5_2 = 15.trad_week_from_opening_7_5_2 16.hybrid_week_from_opening_7_5_2 = 16.trad_week_from_opening_7_5_2 17.hybrid_week_from_opening_7_5_2 = 17.trad_week_from_opening_7_5_2 18.hybrid_week_from_opening_7_5_2 = 18.trad_week_from_opening_7_5_2) coeflabels(1.trad_week_from_opening_7_5_2 = "-4" 2.trad_week_from_opening_7_5_2 = "-3" 3.trad_week_from_opening_7_5_2 = "-2" 4.trad_week_from_opening_7_5_2 = "-1" 5.trad_week_from_opening_7_5_2 = "0" 6.trad_week_from_opening_7_5_2 = "1" 7.trad_week_from_opening_7_5_2 = "2" 8.trad_week_from_opening_7_5_2 = "3" 9.trad_week_from_opening_7_5_2 = "4" 10.trad_week_from_opening_7_5_2 = "5" 11.trad_week_from_opening_7_5_2  = "6" 12.trad_week_from_opening_7_5_2 = "7" 13.trad_week_from_opening_7_5_2 = "8" 14.trad_week_from_opening_7_5_2 = "9" 15.trad_week_from_opening_7_5_2 = "10" 16.trad_week_from_opening_7_5_2 = "11" 17.trad_week_from_opening_7_5_2 = "12" 18.trad_week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)


graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Cases - W - 0-9 - 210419.gph"
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Cases - W - 0-9 - 210419.jpg", as(jpg) name("Graph") quality(100)





*10-19*
*running it once and saving the estimates as hybrid
glm cases_per_pop_10_19_100K i.open1_mean_cat_all i.week_from_opening_7_5_2 i.hybrid_week_from_opening_7_5_2 i.trad_week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if region == 1, f(gamma) l(log) vce(cluster fips)

margins, dydx(hybrid_week_from_opening_7_5_2) post

estimates store hybrid_W_10_19

*running it again and saving the estimates as traditional (I had to take out the Google mobility data to get this to produce something for the margins)
glm cases_per_pop_10_19_100K i.open1_mean_cat_all i.week_from_opening_7_5_2 i.hybrid_week_from_opening_7_5_2 i.trad_week_from_opening_7_5_2     i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if region == 1, f(gamma) l(log) vce(cluster fips)

margins, dydx(trad_week_from_opening_7_5_2) post

estimates store trad_W_10_19

*plotting the coefficients
coefplot (hybrid_W_10_19, label(Hybrid) mlcolor(black) mcolor(gs12) ciopts(color(gs10)))   (trad_W_10_19, label(Traditional) mlcolor(black) mcolor(gs2) ciopts(color(gs2))), yline(0, lcolor(black) lpattern(dash)) vertical rename(1.hybrid_week_from_opening_7_5_2 = 1.trad_week_from_opening_7_5_2 2.hybrid_week_from_opening_7_5_2 = 2.trad_week_from_opening_7_5_2 3.hybrid_week_from_opening_7_5_2 = 3.trad_week_from_opening_7_5_2 4.hybrid_week_from_opening_7_5_2 = 4.trad_week_from_opening_7_5_2 5.hybrid_week_from_opening_7_5_2 = 5.trad_week_from_opening_7_5_2 6.hybrid_week_from_opening_7_5_2 = 6.trad_week_from_opening_7_5_2 7.hybrid_week_from_opening_7_5_2 = 7.trad_week_from_opening_7_5_2 8.hybrid_week_from_opening_7_5_2 = 8.trad_week_from_opening_7_5_2 9.hybrid_week_from_opening_7_5_2 = 9.trad_week_from_opening_7_5_2 10.hybrid_week_from_opening_7_5_2 = 10.trad_week_from_opening_7_5_2 11.hybrid_week_from_opening_7_5_2 = 11.trad_week_from_opening_7_5_2 12.hybrid_week_from_opening_7_5_2 = 12.trad_week_from_opening_7_5_2 13.hybrid_week_from_opening_7_5_2 = 13.trad_week_from_opening_7_5_2 14.hybrid_week_from_opening_7_5_2 = 14.trad_week_from_opening_7_5_2 15.hybrid_week_from_opening_7_5_2 = 15.trad_week_from_opening_7_5_2 16.hybrid_week_from_opening_7_5_2 = 16.trad_week_from_opening_7_5_2 17.hybrid_week_from_opening_7_5_2 = 17.trad_week_from_opening_7_5_2 18.hybrid_week_from_opening_7_5_2 = 18.trad_week_from_opening_7_5_2) coeflabels(1.trad_week_from_opening_7_5_2 = "-4" 2.trad_week_from_opening_7_5_2 = "-3" 3.trad_week_from_opening_7_5_2 = "-2" 4.trad_week_from_opening_7_5_2 = "-1" 5.trad_week_from_opening_7_5_2 = "0" 6.trad_week_from_opening_7_5_2 = "1" 7.trad_week_from_opening_7_5_2 = "2" 8.trad_week_from_opening_7_5_2 = "3" 9.trad_week_from_opening_7_5_2 = "4" 10.trad_week_from_opening_7_5_2 = "5" 11.trad_week_from_opening_7_5_2  = "6" 12.trad_week_from_opening_7_5_2 = "7" 13.trad_week_from_opening_7_5_2 = "8" 14.trad_week_from_opening_7_5_2 = "9" 15.trad_week_from_opening_7_5_2 = "10" 16.trad_week_from_opening_7_5_2 = "11" 17.trad_week_from_opening_7_5_2 = "12" 18.trad_week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)


graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Cases - W - 10-19 - 210419.gph"
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Cases - W - 10-19 - 210419.jpg", as(jpg) name("Graph") quality(100)





*20+*
*running it once and saving the estimates as hybrid
glm cases_per_pop_20_100K i.open1_mean_cat_all i.week_from_opening_7_5_2 i.hybrid_week_from_opening_7_5_2 i.trad_week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if region == 1, f(gamma) l(log) vce(cluster fips)

margins, dydx(hybrid_week_from_opening_7_5_2) post

estimates store hybrid_W_20

*running it again and saving the estimates as traditional (I had to take out the Google mobility data to get this to produce something for the margins)
glm cases_per_pop_20_100K i.open1_mean_cat_all i.week_from_opening_7_5_2 i.hybrid_week_from_opening_7_5_2 i.trad_week_from_opening_7_5_2     i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if region == 1, f(gamma) l(log) vce(cluster fips)

margins, dydx(trad_week_from_opening_7_5_2) post

estimates store trad_W_20

*plotting the coefficients
coefplot (hybrid_W_20, label(Hybrid) mlcolor(black) mcolor(gs12) ciopts(color(gs10)))   (trad_W_20, label(Traditional) mlcolor(black) mcolor(gs2) ciopts(color(gs2))), yline(0, lcolor(black) lpattern(dash)) vertical rename(1.hybrid_week_from_opening_7_5_2 = 1.trad_week_from_opening_7_5_2 2.hybrid_week_from_opening_7_5_2 = 2.trad_week_from_opening_7_5_2 3.hybrid_week_from_opening_7_5_2 = 3.trad_week_from_opening_7_5_2 4.hybrid_week_from_opening_7_5_2 = 4.trad_week_from_opening_7_5_2 5.hybrid_week_from_opening_7_5_2 = 5.trad_week_from_opening_7_5_2 6.hybrid_week_from_opening_7_5_2 = 6.trad_week_from_opening_7_5_2 7.hybrid_week_from_opening_7_5_2 = 7.trad_week_from_opening_7_5_2 8.hybrid_week_from_opening_7_5_2 = 8.trad_week_from_opening_7_5_2 9.hybrid_week_from_opening_7_5_2 = 9.trad_week_from_opening_7_5_2 10.hybrid_week_from_opening_7_5_2 = 10.trad_week_from_opening_7_5_2 11.hybrid_week_from_opening_7_5_2 = 11.trad_week_from_opening_7_5_2 12.hybrid_week_from_opening_7_5_2 = 12.trad_week_from_opening_7_5_2 13.hybrid_week_from_opening_7_5_2 = 13.trad_week_from_opening_7_5_2 14.hybrid_week_from_opening_7_5_2 = 14.trad_week_from_opening_7_5_2 15.hybrid_week_from_opening_7_5_2 = 15.trad_week_from_opening_7_5_2 16.hybrid_week_from_opening_7_5_2 = 16.trad_week_from_opening_7_5_2 17.hybrid_week_from_opening_7_5_2 = 17.trad_week_from_opening_7_5_2 18.hybrid_week_from_opening_7_5_2 = 18.trad_week_from_opening_7_5_2) coeflabels(1.trad_week_from_opening_7_5_2 = "-4" 2.trad_week_from_opening_7_5_2 = "-3" 3.trad_week_from_opening_7_5_2 = "-2" 4.trad_week_from_opening_7_5_2 = "-1" 5.trad_week_from_opening_7_5_2 = "0" 6.trad_week_from_opening_7_5_2 = "1" 7.trad_week_from_opening_7_5_2 = "2" 8.trad_week_from_opening_7_5_2 = "3" 9.trad_week_from_opening_7_5_2 = "4" 10.trad_week_from_opening_7_5_2 = "5" 11.trad_week_from_opening_7_5_2  = "6" 12.trad_week_from_opening_7_5_2 = "7" 13.trad_week_from_opening_7_5_2 = "8" 14.trad_week_from_opening_7_5_2 = "9" 15.trad_week_from_opening_7_5_2 = "10" 16.trad_week_from_opening_7_5_2 = "11" 17.trad_week_from_opening_7_5_2 = "12" 18.trad_week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)


graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Cases - W - 20 - 210419.gph"
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Cases - W - 20 - 210419.jpg", as(jpg) name("Graph") quality(100)






**MW***
*all ages* (i took out the state*week interaction so that the margins results would be interpretable)
*running it once and saving the estimates as hybrid
glm deaths_per_pop_100K i.open1_mean_cat_all i.week_from_opening_7_5_2 i.hybrid_week_from_opening_7_5_2 i.trad_week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips  i.fips if region == 2 & week_from_opening_7_5_2 < 18, f(poisson) l(log) vce(cluster fips) iterate(10)

margins, dydx(hybrid_week_from_opening_7_5_2) post

estimates store deaths_hybrid_MW_all

*running it again and saving the estimates as traditional
glm deaths_per_pop_100K i.open1_mean_cat_all i.week_from_opening_7_5_2 i.hybrid_week_from_opening_7_5_2 i.trad_week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips  i.fips if region == 2 & week_from_opening_7_5_2 < 18, f(poisson) l(log) vce(cluster fips) iterate(10)

margins, dydx(trad_week_from_opening_7_5_2) post

estimates store deaths_trad_MW_all

*plotting the coefficients
coefplot (deaths_hybrid_MW_all, label(Hybrid) mlcolor(black) mcolor(gs12) ciopts(color(gs10)))   (deaths_trad_MW_all, label(Traditional) mlcolor(black) mcolor(gs2) ciopts(color(gs2))), yline(0, lcolor(black) lpattern(dash)) vertical rename(1.hybrid_week_from_opening_7_5_2 = 1.trad_week_from_opening_7_5_2 2.hybrid_week_from_opening_7_5_2 = 2.trad_week_from_opening_7_5_2 3.hybrid_week_from_opening_7_5_2 = 3.trad_week_from_opening_7_5_2 4.hybrid_week_from_opening_7_5_2 = 4.trad_week_from_opening_7_5_2 5.hybrid_week_from_opening_7_5_2 = 5.trad_week_from_opening_7_5_2 6.hybrid_week_from_opening_7_5_2 = 6.trad_week_from_opening_7_5_2 7.hybrid_week_from_opening_7_5_2 = 7.trad_week_from_opening_7_5_2 8.hybrid_week_from_opening_7_5_2 = 8.trad_week_from_opening_7_5_2 9.hybrid_week_from_opening_7_5_2 = 9.trad_week_from_opening_7_5_2 10.hybrid_week_from_opening_7_5_2 = 10.trad_week_from_opening_7_5_2 11.hybrid_week_from_opening_7_5_2 = 11.trad_week_from_opening_7_5_2 12.hybrid_week_from_opening_7_5_2 = 12.trad_week_from_opening_7_5_2 13.hybrid_week_from_opening_7_5_2 = 13.trad_week_from_opening_7_5_2 14.hybrid_week_from_opening_7_5_2 = 14.trad_week_from_opening_7_5_2 15.hybrid_week_from_opening_7_5_2 = 15.trad_week_from_opening_7_5_2 16.hybrid_week_from_opening_7_5_2 = 16.trad_week_from_opening_7_5_2 17.hybrid_week_from_opening_7_5_2 = 17.trad_week_from_opening_7_5_2 18.hybrid_week_from_opening_7_5_2 = 18.trad_week_from_opening_7_5_2) coeflabels(1.trad_week_from_opening_7_5_2 = "-4" 2.trad_week_from_opening_7_5_2 = "-3" 3.trad_week_from_opening_7_5_2 = "-2" 4.trad_week_from_opening_7_5_2 = "-1" 5.trad_week_from_opening_7_5_2 = "0" 6.trad_week_from_opening_7_5_2 = "1" 7.trad_week_from_opening_7_5_2 = "2" 8.trad_week_from_opening_7_5_2 = "3" 9.trad_week_from_opening_7_5_2 = "4" 10.trad_week_from_opening_7_5_2 = "5" 11.trad_week_from_opening_7_5_2  = "6" 12.trad_week_from_opening_7_5_2 = "7" 13.trad_week_from_opening_7_5_2 = "8" 14.trad_week_from_opening_7_5_2 = "9" 15.trad_week_from_opening_7_5_2 = "10" 16.trad_week_from_opening_7_5_2 = "11" 17.trad_week_from_opening_7_5_2 = "12" 18.trad_week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)


graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Deaths - MW - All Ages - 210510.gph", replace
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Deaths - MW - All Ages - 210510.jpg", as(jpg) name("Graph") quality(100) replace





*0-9*
*running it once and saving the estimates as hybrid
glm cases_per_pop_0_9_100K i.open1_mean_cat_all i.week_from_opening_7_5_2 i.hybrid_week_from_opening_7_5_2 i.trad_week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if region == 2, f(gamma) l(log) vce(cluster fips)

margins, dydx(hybrid_week_from_opening_7_5_2) post

estimates store hybrid_MW_0_9

*running it again and saving the estimates as traditional
glm cases_per_pop_0_9_100K i.open1_mean_cat_all i.week_from_opening_7_5_2 i.hybrid_week_from_opening_7_5_2 i.trad_week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if region == 2, f(gamma) l(log) vce(cluster fips)

margins, dydx(trad_week_from_opening_7_5_2) post

estimates store trad_MW_0_9

*plotting the coefficients
coefplot (hybrid_MW_0_9, label(Hybrid) mlcolor(black) mcolor(gs12) ciopts(color(gs10)))   (trad_MW_0_9, label(Traditional) mlcolor(black) mcolor(gs2) ciopts(color(gs2))), yline(0, lcolor(black) lpattern(dash)) vertical rename(1.hybrid_week_from_opening_7_5_2 = 1.trad_week_from_opening_7_5_2 2.hybrid_week_from_opening_7_5_2 = 2.trad_week_from_opening_7_5_2 3.hybrid_week_from_opening_7_5_2 = 3.trad_week_from_opening_7_5_2 4.hybrid_week_from_opening_7_5_2 = 4.trad_week_from_opening_7_5_2 5.hybrid_week_from_opening_7_5_2 = 5.trad_week_from_opening_7_5_2 6.hybrid_week_from_opening_7_5_2 = 6.trad_week_from_opening_7_5_2 7.hybrid_week_from_opening_7_5_2 = 7.trad_week_from_opening_7_5_2 8.hybrid_week_from_opening_7_5_2 = 8.trad_week_from_opening_7_5_2 9.hybrid_week_from_opening_7_5_2 = 9.trad_week_from_opening_7_5_2 10.hybrid_week_from_opening_7_5_2 = 10.trad_week_from_opening_7_5_2 11.hybrid_week_from_opening_7_5_2 = 11.trad_week_from_opening_7_5_2 12.hybrid_week_from_opening_7_5_2 = 12.trad_week_from_opening_7_5_2 13.hybrid_week_from_opening_7_5_2 = 13.trad_week_from_opening_7_5_2 14.hybrid_week_from_opening_7_5_2 = 14.trad_week_from_opening_7_5_2 15.hybrid_week_from_opening_7_5_2 = 15.trad_week_from_opening_7_5_2 16.hybrid_week_from_opening_7_5_2 = 16.trad_week_from_opening_7_5_2 17.hybrid_week_from_opening_7_5_2 = 17.trad_week_from_opening_7_5_2 18.hybrid_week_from_opening_7_5_2 = 18.trad_week_from_opening_7_5_2) coeflabels(1.trad_week_from_opening_7_5_2 = "-4" 2.trad_week_from_opening_7_5_2 = "-3" 3.trad_week_from_opening_7_5_2 = "-2" 4.trad_week_from_opening_7_5_2 = "-1" 5.trad_week_from_opening_7_5_2 = "0" 6.trad_week_from_opening_7_5_2 = "1" 7.trad_week_from_opening_7_5_2 = "2" 8.trad_week_from_opening_7_5_2 = "3" 9.trad_week_from_opening_7_5_2 = "4" 10.trad_week_from_opening_7_5_2 = "5" 11.trad_week_from_opening_7_5_2  = "6" 12.trad_week_from_opening_7_5_2 = "7" 13.trad_week_from_opening_7_5_2 = "8" 14.trad_week_from_opening_7_5_2 = "9" 15.trad_week_from_opening_7_5_2 = "10" 16.trad_week_from_opening_7_5_2 = "11" 17.trad_week_from_opening_7_5_2 = "12" 18.trad_week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)


graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Cases - MW - 0-9 - 210419.gph"
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Cases - MW - 0-9 - 210419.jpg", as(jpg) name("Graph") quality(100)





*10-19*
*running it once and saving the estimates as hybrid
glm cases_per_pop_10_19_100K i.open1_mean_cat_all i.week_from_opening_7_5_2 i.hybrid_week_from_opening_7_5_2 i.trad_week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if region == 2, f(gamma) l(log) vce(cluster fips)

margins, dydx(hybrid_week_from_opening_7_5_2) post

estimates store hybrid_MW_10_19

*running it again and saving the estimates as traditional
glm cases_per_pop_10_19_100K i.open1_mean_cat_all i.week_from_opening_7_5_2 i.hybrid_week_from_opening_7_5_2 i.trad_week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if region == 2, f(gamma) l(log) vce(cluster fips)

margins, dydx(trad_week_from_opening_7_5_2) post

estimates store trad_MW_10_19

*plotting the coefficients
coefplot (hybrid_MW_10_19, label(Hybrid) mlcolor(black) mcolor(gs12) ciopts(color(gs10)))   (trad_MW_10_19, label(Traditional) mlcolor(black) mcolor(gs2) ciopts(color(gs2))), yline(0, lcolor(black) lpattern(dash)) vertical rename(1.hybrid_week_from_opening_7_5_2 = 1.trad_week_from_opening_7_5_2 2.hybrid_week_from_opening_7_5_2 = 2.trad_week_from_opening_7_5_2 3.hybrid_week_from_opening_7_5_2 = 3.trad_week_from_opening_7_5_2 4.hybrid_week_from_opening_7_5_2 = 4.trad_week_from_opening_7_5_2 5.hybrid_week_from_opening_7_5_2 = 5.trad_week_from_opening_7_5_2 6.hybrid_week_from_opening_7_5_2 = 6.trad_week_from_opening_7_5_2 7.hybrid_week_from_opening_7_5_2 = 7.trad_week_from_opening_7_5_2 8.hybrid_week_from_opening_7_5_2 = 8.trad_week_from_opening_7_5_2 9.hybrid_week_from_opening_7_5_2 = 9.trad_week_from_opening_7_5_2 10.hybrid_week_from_opening_7_5_2 = 10.trad_week_from_opening_7_5_2 11.hybrid_week_from_opening_7_5_2 = 11.trad_week_from_opening_7_5_2 12.hybrid_week_from_opening_7_5_2 = 12.trad_week_from_opening_7_5_2 13.hybrid_week_from_opening_7_5_2 = 13.trad_week_from_opening_7_5_2 14.hybrid_week_from_opening_7_5_2 = 14.trad_week_from_opening_7_5_2 15.hybrid_week_from_opening_7_5_2 = 15.trad_week_from_opening_7_5_2 16.hybrid_week_from_opening_7_5_2 = 16.trad_week_from_opening_7_5_2 17.hybrid_week_from_opening_7_5_2 = 17.trad_week_from_opening_7_5_2 18.hybrid_week_from_opening_7_5_2 = 18.trad_week_from_opening_7_5_2) coeflabels(1.trad_week_from_opening_7_5_2 = "-4" 2.trad_week_from_opening_7_5_2 = "-3" 3.trad_week_from_opening_7_5_2 = "-2" 4.trad_week_from_opening_7_5_2 = "-1" 5.trad_week_from_opening_7_5_2 = "0" 6.trad_week_from_opening_7_5_2 = "1" 7.trad_week_from_opening_7_5_2 = "2" 8.trad_week_from_opening_7_5_2 = "3" 9.trad_week_from_opening_7_5_2 = "4" 10.trad_week_from_opening_7_5_2 = "5" 11.trad_week_from_opening_7_5_2  = "6" 12.trad_week_from_opening_7_5_2 = "7" 13.trad_week_from_opening_7_5_2 = "8" 14.trad_week_from_opening_7_5_2 = "9" 15.trad_week_from_opening_7_5_2 = "10" 16.trad_week_from_opening_7_5_2 = "11" 17.trad_week_from_opening_7_5_2 = "12" 18.trad_week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)


graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Cases - MW - 10-19 - 210419.gph"
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Cases - MW - 10-19 - 210419.jpg", as(jpg) name("Graph") quality(100)





*20+*
*running it once and saving the estimates as hybrid
glm cases_per_pop_20_100K i.open1_mean_cat_all i.week_from_opening_7_5_2 i.hybrid_week_from_opening_7_5_2 i.trad_week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if region == 2, f(gamma) l(log) vce(cluster fips)

margins, dydx(hybrid_week_from_opening_7_5_2) post

estimates store hybrid_MW_20

*running it again and saving the estimates as traditional
glm cases_per_pop_20_100K i.open1_mean_cat_all i.week_from_opening_7_5_2 i.hybrid_week_from_opening_7_5_2 i.trad_week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if region == 2, f(gamma) l(log) vce(cluster fips)

margins, dydx(trad_week_from_opening_7_5_2) post

estimates store trad_MW_20

*plotting the coefficients
coefplot (hybrid_MW_20, label(Hybrid) mlcolor(black) mcolor(gs12) ciopts(color(gs10)))   (trad_MW_20, label(Traditional) mlcolor(black) mcolor(gs2) ciopts(color(gs2))), yline(0, lcolor(black) lpattern(dash)) vertical rename(1.hybrid_week_from_opening_7_5_2 = 1.trad_week_from_opening_7_5_2 2.hybrid_week_from_opening_7_5_2 = 2.trad_week_from_opening_7_5_2 3.hybrid_week_from_opening_7_5_2 = 3.trad_week_from_opening_7_5_2 4.hybrid_week_from_opening_7_5_2 = 4.trad_week_from_opening_7_5_2 5.hybrid_week_from_opening_7_5_2 = 5.trad_week_from_opening_7_5_2 6.hybrid_week_from_opening_7_5_2 = 6.trad_week_from_opening_7_5_2 7.hybrid_week_from_opening_7_5_2 = 7.trad_week_from_opening_7_5_2 8.hybrid_week_from_opening_7_5_2 = 8.trad_week_from_opening_7_5_2 9.hybrid_week_from_opening_7_5_2 = 9.trad_week_from_opening_7_5_2 10.hybrid_week_from_opening_7_5_2 = 10.trad_week_from_opening_7_5_2 11.hybrid_week_from_opening_7_5_2 = 11.trad_week_from_opening_7_5_2 12.hybrid_week_from_opening_7_5_2 = 12.trad_week_from_opening_7_5_2 13.hybrid_week_from_opening_7_5_2 = 13.trad_week_from_opening_7_5_2 14.hybrid_week_from_opening_7_5_2 = 14.trad_week_from_opening_7_5_2 15.hybrid_week_from_opening_7_5_2 = 15.trad_week_from_opening_7_5_2 16.hybrid_week_from_opening_7_5_2 = 16.trad_week_from_opening_7_5_2 17.hybrid_week_from_opening_7_5_2 = 17.trad_week_from_opening_7_5_2 18.hybrid_week_from_opening_7_5_2 = 18.trad_week_from_opening_7_5_2) coeflabels(1.trad_week_from_opening_7_5_2 = "-4" 2.trad_week_from_opening_7_5_2 = "-3" 3.trad_week_from_opening_7_5_2 = "-2" 4.trad_week_from_opening_7_5_2 = "-1" 5.trad_week_from_opening_7_5_2 = "0" 6.trad_week_from_opening_7_5_2 = "1" 7.trad_week_from_opening_7_5_2 = "2" 8.trad_week_from_opening_7_5_2 = "3" 9.trad_week_from_opening_7_5_2 = "4" 10.trad_week_from_opening_7_5_2 = "5" 11.trad_week_from_opening_7_5_2  = "6" 12.trad_week_from_opening_7_5_2 = "7" 13.trad_week_from_opening_7_5_2 = "8" 14.trad_week_from_opening_7_5_2 = "9" 15.trad_week_from_opening_7_5_2 = "10" 16.trad_week_from_opening_7_5_2 = "11" 17.trad_week_from_opening_7_5_2 = "12" 18.trad_week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)


graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Cases - MW - 20 - 210419.gph"
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Cases - MW - 20 - 210419.jpg", as(jpg) name("Graph") quality(100)







**S***
*all ages*
*running it once and saving the estimates as hybrid
glm deaths_per_pop_100K i.open1_mean_cat_all i.week_from_opening_7_5_2 i.hybrid_week_from_opening_7_5_2 i.trad_week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips  if region == 3 & week_from_opening_7_5_2 < 18, f(poisson) l(log) vce(cluster fips) iterate(10)

margins, dydx(hybrid_week_from_opening_7_5_2) post

estimates store deaths_hybrid_S_all

*running it again and saving the estimates as traditional
glm deaths_per_pop_100K i.open1_mean_cat_all i.week_from_opening_7_5_2 i.hybrid_week_from_opening_7_5_2 i.trad_week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips  if region == 3 & week_from_opening_7_5_2 < 18, f(poisson) l(log) vce(cluster fips) iterate(10)

margins, dydx(trad_week_from_opening_7_5_2) post

estimates store deaths_trad_S_all

*plotting the coefficients
coefplot (deaths_hybrid_S_all, label(Hybrid) mlcolor(black) mcolor(gs12) ciopts(color(gs10)))   (deaths_trad_S_all, label(Traditional) mlcolor(black) mcolor(gs2) ciopts(color(gs2))), yline(0, lcolor(black) lpattern(dash)) vertical rename(1.hybrid_week_from_opening_7_5_2 = 1.trad_week_from_opening_7_5_2 2.hybrid_week_from_opening_7_5_2 = 2.trad_week_from_opening_7_5_2 3.hybrid_week_from_opening_7_5_2 = 3.trad_week_from_opening_7_5_2 4.hybrid_week_from_opening_7_5_2 = 4.trad_week_from_opening_7_5_2 5.hybrid_week_from_opening_7_5_2 = 5.trad_week_from_opening_7_5_2 6.hybrid_week_from_opening_7_5_2 = 6.trad_week_from_opening_7_5_2 7.hybrid_week_from_opening_7_5_2 = 7.trad_week_from_opening_7_5_2 8.hybrid_week_from_opening_7_5_2 = 8.trad_week_from_opening_7_5_2 9.hybrid_week_from_opening_7_5_2 = 9.trad_week_from_opening_7_5_2 10.hybrid_week_from_opening_7_5_2 = 10.trad_week_from_opening_7_5_2 11.hybrid_week_from_opening_7_5_2 = 11.trad_week_from_opening_7_5_2 12.hybrid_week_from_opening_7_5_2 = 12.trad_week_from_opening_7_5_2 13.hybrid_week_from_opening_7_5_2 = 13.trad_week_from_opening_7_5_2 14.hybrid_week_from_opening_7_5_2 = 14.trad_week_from_opening_7_5_2 15.hybrid_week_from_opening_7_5_2 = 15.trad_week_from_opening_7_5_2 16.hybrid_week_from_opening_7_5_2 = 16.trad_week_from_opening_7_5_2 17.hybrid_week_from_opening_7_5_2 = 17.trad_week_from_opening_7_5_2 18.hybrid_week_from_opening_7_5_2 = 18.trad_week_from_opening_7_5_2) coeflabels(1.trad_week_from_opening_7_5_2 = "-4" 2.trad_week_from_opening_7_5_2 = "-3" 3.trad_week_from_opening_7_5_2 = "-2" 4.trad_week_from_opening_7_5_2 = "-1" 5.trad_week_from_opening_7_5_2 = "0" 6.trad_week_from_opening_7_5_2 = "1" 7.trad_week_from_opening_7_5_2 = "2" 8.trad_week_from_opening_7_5_2 = "3" 9.trad_week_from_opening_7_5_2 = "4" 10.trad_week_from_opening_7_5_2 = "5" 11.trad_week_from_opening_7_5_2  = "6" 12.trad_week_from_opening_7_5_2 = "7" 13.trad_week_from_opening_7_5_2 = "8" 14.trad_week_from_opening_7_5_2 = "9" 15.trad_week_from_opening_7_5_2 = "10" 16.trad_week_from_opening_7_5_2 = "11" 17.trad_week_from_opening_7_5_2 = "12" 18.trad_week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)


graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Deaths - S - All Ages - 210510.gph", replace
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Deaths - S - All Ages - 210510.jpg", as(jpg) name("Graph") quality(100) replace






*0-9*
*running it once and saving the estimates as hybrid
glm cases_per_pop_0_9_100K i.open1_mean_cat_all i.week_from_opening_7_5_2 i.hybrid_week_from_opening_7_5_2 i.trad_week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if region == 3, f(gamma) l(log) vce(cluster fips)

margins, dydx(hybrid_week_from_opening_7_5_2) post

estimates store hybrid_S_0_9

*running it again and saving the estimates as traditional
glm cases_per_pop_0_9_100K i.open1_mean_cat_all i.week_from_opening_7_5_2 i.hybrid_week_from_opening_7_5_2 i.trad_week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if region == 3, f(gamma) l(log) vce(cluster fips)

margins, dydx(trad_week_from_opening_7_5_2) post

estimates store trad_S_0_9

*plotting the coefficients
coefplot (hybrid_S_0_9, label(Hybrid) mlcolor(black) mcolor(gs12) ciopts(color(gs10)))   (trad_S_0_9, label(Traditional) mlcolor(black) mcolor(gs2) ciopts(color(gs2))), yline(0, lcolor(black) lpattern(dash)) vertical rename(1.hybrid_week_from_opening_7_5_2 = 1.trad_week_from_opening_7_5_2 2.hybrid_week_from_opening_7_5_2 = 2.trad_week_from_opening_7_5_2 3.hybrid_week_from_opening_7_5_2 = 3.trad_week_from_opening_7_5_2 4.hybrid_week_from_opening_7_5_2 = 4.trad_week_from_opening_7_5_2 5.hybrid_week_from_opening_7_5_2 = 5.trad_week_from_opening_7_5_2 6.hybrid_week_from_opening_7_5_2 = 6.trad_week_from_opening_7_5_2 7.hybrid_week_from_opening_7_5_2 = 7.trad_week_from_opening_7_5_2 8.hybrid_week_from_opening_7_5_2 = 8.trad_week_from_opening_7_5_2 9.hybrid_week_from_opening_7_5_2 = 9.trad_week_from_opening_7_5_2 10.hybrid_week_from_opening_7_5_2 = 10.trad_week_from_opening_7_5_2 11.hybrid_week_from_opening_7_5_2 = 11.trad_week_from_opening_7_5_2 12.hybrid_week_from_opening_7_5_2 = 12.trad_week_from_opening_7_5_2 13.hybrid_week_from_opening_7_5_2 = 13.trad_week_from_opening_7_5_2 14.hybrid_week_from_opening_7_5_2 = 14.trad_week_from_opening_7_5_2 15.hybrid_week_from_opening_7_5_2 = 15.trad_week_from_opening_7_5_2 16.hybrid_week_from_opening_7_5_2 = 16.trad_week_from_opening_7_5_2 17.hybrid_week_from_opening_7_5_2 = 17.trad_week_from_opening_7_5_2 18.hybrid_week_from_opening_7_5_2 = 18.trad_week_from_opening_7_5_2) coeflabels(1.trad_week_from_opening_7_5_2 = "-4" 2.trad_week_from_opening_7_5_2 = "-3" 3.trad_week_from_opening_7_5_2 = "-2" 4.trad_week_from_opening_7_5_2 = "-1" 5.trad_week_from_opening_7_5_2 = "0" 6.trad_week_from_opening_7_5_2 = "1" 7.trad_week_from_opening_7_5_2 = "2" 8.trad_week_from_opening_7_5_2 = "3" 9.trad_week_from_opening_7_5_2 = "4" 10.trad_week_from_opening_7_5_2 = "5" 11.trad_week_from_opening_7_5_2  = "6" 12.trad_week_from_opening_7_5_2 = "7" 13.trad_week_from_opening_7_5_2 = "8" 14.trad_week_from_opening_7_5_2 = "9" 15.trad_week_from_opening_7_5_2 = "10" 16.trad_week_from_opening_7_5_2 = "11" 17.trad_week_from_opening_7_5_2 = "12" 18.trad_week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)


graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Cases - S - 0-9 - 210419.gph"
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Cases - S - 0-9 - 210419.jpg", as(jpg) name("Graph") quality(100)





*10-19*
*running it once and saving the estimates as hybrid
glm cases_per_pop_10_19_100K i.open1_mean_cat_all i.week_from_opening_7_5_2 i.hybrid_week_from_opening_7_5_2 i.trad_week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if region == 3, f(gamma) l(log) vce(cluster fips)

margins, dydx(hybrid_week_from_opening_7_5_2) post

estimates store hybrid_S_10_19

*running it again and saving the estimates as traditional
glm cases_per_pop_10_19_100K i.open1_mean_cat_all i.week_from_opening_7_5_2 i.hybrid_week_from_opening_7_5_2 i.trad_week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if region == 3, f(gamma) l(log) vce(cluster fips)

margins, dydx(trad_week_from_opening_7_5_2) post

estimates store trad_S_10_19

*plotting the coefficients
coefplot (hybrid_S_10_19, label(Hybrid) mlcolor(black) mcolor(gs12) ciopts(color(gs10)))   (trad_S_10_19, label(Traditional) mlcolor(black) mcolor(gs2) ciopts(color(gs2))), yline(0, lcolor(black) lpattern(dash)) vertical rename(1.hybrid_week_from_opening_7_5_2 = 1.trad_week_from_opening_7_5_2 2.hybrid_week_from_opening_7_5_2 = 2.trad_week_from_opening_7_5_2 3.hybrid_week_from_opening_7_5_2 = 3.trad_week_from_opening_7_5_2 4.hybrid_week_from_opening_7_5_2 = 4.trad_week_from_opening_7_5_2 5.hybrid_week_from_opening_7_5_2 = 5.trad_week_from_opening_7_5_2 6.hybrid_week_from_opening_7_5_2 = 6.trad_week_from_opening_7_5_2 7.hybrid_week_from_opening_7_5_2 = 7.trad_week_from_opening_7_5_2 8.hybrid_week_from_opening_7_5_2 = 8.trad_week_from_opening_7_5_2 9.hybrid_week_from_opening_7_5_2 = 9.trad_week_from_opening_7_5_2 10.hybrid_week_from_opening_7_5_2 = 10.trad_week_from_opening_7_5_2 11.hybrid_week_from_opening_7_5_2 = 11.trad_week_from_opening_7_5_2 12.hybrid_week_from_opening_7_5_2 = 12.trad_week_from_opening_7_5_2 13.hybrid_week_from_opening_7_5_2 = 13.trad_week_from_opening_7_5_2 14.hybrid_week_from_opening_7_5_2 = 14.trad_week_from_opening_7_5_2 15.hybrid_week_from_opening_7_5_2 = 15.trad_week_from_opening_7_5_2 16.hybrid_week_from_opening_7_5_2 = 16.trad_week_from_opening_7_5_2 17.hybrid_week_from_opening_7_5_2 = 17.trad_week_from_opening_7_5_2 18.hybrid_week_from_opening_7_5_2 = 18.trad_week_from_opening_7_5_2) coeflabels(1.trad_week_from_opening_7_5_2 = "-4" 2.trad_week_from_opening_7_5_2 = "-3" 3.trad_week_from_opening_7_5_2 = "-2" 4.trad_week_from_opening_7_5_2 = "-1" 5.trad_week_from_opening_7_5_2 = "0" 6.trad_week_from_opening_7_5_2 = "1" 7.trad_week_from_opening_7_5_2 = "2" 8.trad_week_from_opening_7_5_2 = "3" 9.trad_week_from_opening_7_5_2 = "4" 10.trad_week_from_opening_7_5_2 = "5" 11.trad_week_from_opening_7_5_2  = "6" 12.trad_week_from_opening_7_5_2 = "7" 13.trad_week_from_opening_7_5_2 = "8" 14.trad_week_from_opening_7_5_2 = "9" 15.trad_week_from_opening_7_5_2 = "10" 16.trad_week_from_opening_7_5_2 = "11" 17.trad_week_from_opening_7_5_2 = "12" 18.trad_week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)


graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Cases - S - 10-19 - 210419.gph"
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Cases - S - 10-19 - 210419.jpg", as(jpg) name("Graph") quality(100)





*20+*
*running it once and saving the estimates as hybrid
glm cases_per_pop_20_100K i.open1_mean_cat_all i.week_from_opening_7_5_2 i.hybrid_week_from_opening_7_5_2 i.trad_week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if region == 3, f(gamma) l(log) vce(cluster fips)

margins, dydx(hybrid_week_from_opening_7_5_2) post

estimates store hybrid_S_20

*running it again and saving the estimates as traditional
glm cases_per_pop_20_100K i.open1_mean_cat_all i.week_from_opening_7_5_2 i.hybrid_week_from_opening_7_5_2 i.trad_week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if region == 3, f(gamma) l(log) vce(cluster fips)

margins, dydx(trad_week_from_opening_7_5_2) post

estimates store trad_S_20

*plotting the coefficients
coefplot (hybrid_S_20, label(Hybrid) mlcolor(black) mcolor(gs12) ciopts(color(gs10)))   (trad_S_20, label(Traditional) mlcolor(black) mcolor(gs2) ciopts(color(gs2))), yline(0, lcolor(black) lpattern(dash)) vertical rename(1.hybrid_week_from_opening_7_5_2 = 1.trad_week_from_opening_7_5_2 2.hybrid_week_from_opening_7_5_2 = 2.trad_week_from_opening_7_5_2 3.hybrid_week_from_opening_7_5_2 = 3.trad_week_from_opening_7_5_2 4.hybrid_week_from_opening_7_5_2 = 4.trad_week_from_opening_7_5_2 5.hybrid_week_from_opening_7_5_2 = 5.trad_week_from_opening_7_5_2 6.hybrid_week_from_opening_7_5_2 = 6.trad_week_from_opening_7_5_2 7.hybrid_week_from_opening_7_5_2 = 7.trad_week_from_opening_7_5_2 8.hybrid_week_from_opening_7_5_2 = 8.trad_week_from_opening_7_5_2 9.hybrid_week_from_opening_7_5_2 = 9.trad_week_from_opening_7_5_2 10.hybrid_week_from_opening_7_5_2 = 10.trad_week_from_opening_7_5_2 11.hybrid_week_from_opening_7_5_2 = 11.trad_week_from_opening_7_5_2 12.hybrid_week_from_opening_7_5_2 = 12.trad_week_from_opening_7_5_2 13.hybrid_week_from_opening_7_5_2 = 13.trad_week_from_opening_7_5_2 14.hybrid_week_from_opening_7_5_2 = 14.trad_week_from_opening_7_5_2 15.hybrid_week_from_opening_7_5_2 = 15.trad_week_from_opening_7_5_2 16.hybrid_week_from_opening_7_5_2 = 16.trad_week_from_opening_7_5_2 17.hybrid_week_from_opening_7_5_2 = 17.trad_week_from_opening_7_5_2 18.hybrid_week_from_opening_7_5_2 = 18.trad_week_from_opening_7_5_2) coeflabels(1.trad_week_from_opening_7_5_2 = "-4" 2.trad_week_from_opening_7_5_2 = "-3" 3.trad_week_from_opening_7_5_2 = "-2" 4.trad_week_from_opening_7_5_2 = "-1" 5.trad_week_from_opening_7_5_2 = "0" 6.trad_week_from_opening_7_5_2 = "1" 7.trad_week_from_opening_7_5_2 = "2" 8.trad_week_from_opening_7_5_2 = "3" 9.trad_week_from_opening_7_5_2 = "4" 10.trad_week_from_opening_7_5_2 = "5" 11.trad_week_from_opening_7_5_2  = "6" 12.trad_week_from_opening_7_5_2 = "7" 13.trad_week_from_opening_7_5_2 = "8" 14.trad_week_from_opening_7_5_2 = "9" 15.trad_week_from_opening_7_5_2 = "10" 16.trad_week_from_opening_7_5_2 = "11" 17.trad_week_from_opening_7_5_2 = "12" 18.trad_week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)


graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Cases - S - 20 - 210419.gph"
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Cases - S - 20 - 210419.jpg", as(jpg) name("Graph") quality(100)


























*hybrid
reg cases_per_pop_log hybrid_traditional i.week_from_opening_7_5_2 hybrid_traditional#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.c7_flag i.c8_internattravelcontrols_cat i.h2_testingpolicy_cat i.h3_contacttracing_cat i.h6_facialcoverings_cat i.fips if hybrid == 1, vce(cluster fips) coeflegend

estimates store hybrid

reg cases_per_pop_log hybrid_traditional i.week_from_opening_7_5_2 hybrid_traditional#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.c7_flag i.c8_internattravelcontrols_cat i.h2_testingpolicy_cat i.h3_contacttracing_cat i.h6_facialcoverings_cat i.fips if traditional == 1, vce(cluster fips) coeflegend

estimates store traditional

1o.hybrid_traditional#0b.week_from_opening_7_5_2







***CASES (log OLS)
**overall
*previous cases
reg cases_per_pop_log i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 cases_per_pop_prior_week_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ c2_workplaceclosing_10 c2_workplaceclosing_20 c2_workplaceclosing_30  c3_cancelpublicevents_10 c3_cancelpublicevents_20   c4_restrictionsongatherings_10 c4_restrictionsongatherings_20 c4_restrictionsongatherings_30 c4_restrictionsongatherings_40 c5_closepublictransport_10 c5_closepublictransport_20  c6_stayathomerequirements_10 c6_stayathomerequirements_20  c7_restrictionsoninternalmovemen c8_internationaltravelcontrols_1 c8_internationaltravelcontrols_2 c8_internationaltravelcontrols_3 h1_publicinformationcampaigns_10 h1_publicinformationcampaigns_20 h2_testingpolicy_10 h2_testingpolicy_20 h2_testingpolicy_30 h3_contacttracing_10 h3_contacttracing_20 h6_facialcoverings_10 h6_facialcoverings_20 h6_facialcoverings_30 h6_facialcoverings_40 i.fips, vce(cluster fips)






log using "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\COVID School Analyses - 210329.smcl", replace

**overall
*running it once and saving the estimates as hybrid
reg cases_per_pop_log i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips, vce(cluster fips)

estimates store hybrid_overall

*running it again and saving the estimates as traditional
reg cases_per_pop_log i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips, vce(cluster fips)

estimates store traditional_overall

**PLOTTING THE COEFFICIENTS*****
coefplot (hybrid_overall, keep(1.open1_mean_cat_all#1.week_from_opening_7_5_2 1.open1_mean_cat_all#2.week_from_opening_7_5_2 1.open1_mean_cat_all#3.week_from_opening_7_5_2 1.open1_mean_cat_all#4.week_from_opening_7_5_2 1.open1_mean_cat_all#5.week_from_opening_7_5_2 1.open1_mean_cat_all#6.week_from_opening_7_5_2 1.open1_mean_cat_all#7.week_from_opening_7_5_2 1.open1_mean_cat_all#8.week_from_opening_7_5_2 1.open1_mean_cat_all#9.week_from_opening_7_5_2 1.open1_mean_cat_all#10.week_from_opening_7_5_2 1.open1_mean_cat_all#11.week_from_opening_7_5_2 1.open1_mean_cat_all#12.week_from_opening_7_5_2 1.open1_mean_cat_all#13.week_from_opening_7_5_2 1.open1_mean_cat_all#14.week_from_opening_7_5_2 1.open1_mean_cat_all#15.week_from_opening_7_5_2 1.open1_mean_cat_all#16.week_from_opening_7_5_2 1.open1_mean_cat_all#17.week_from_opening_7_5_2 1.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Hybrid) mlcolor(black))   (traditional_overall, keep(2.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Traditional) mlcolor(black)), yline(0, lcolor(black) lpattern(dash)) vertical rename(2.open1_mean_cat_all#1.week_from_opening_7_5_2 = 1.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 = 1.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 = 1.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 = 1.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 = 1.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 = 1.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 = 1.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 = 1.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 = 1.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 = 1.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 = 1.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 = 1.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 = 1.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 = 1.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 = 1.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 = 1.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 = 1.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2 = 1.open1_mean_cat_all#18.week_from_opening_7_5_2) coeflabels(1.open1_mean_cat_all#1.week_from_opening_7_5_2 = "-4" 1.open1_mean_cat_all#2.week_from_opening_7_5_2 = "-3" 1.open1_mean_cat_all#3.week_from_opening_7_5_2 = "-2" 1.open1_mean_cat_all#4.week_from_opening_7_5_2 = "-1" 1.open1_mean_cat_all#5.week_from_opening_7_5_2 = "0" 1.open1_mean_cat_all#6.week_from_opening_7_5_2 = "1" 1.open1_mean_cat_all#7.week_from_opening_7_5_2 = "2" 1.open1_mean_cat_all#8.week_from_opening_7_5_2 = "3" 1.open1_mean_cat_all#9.week_from_opening_7_5_2 = "4" 1.open1_mean_cat_all#10.week_from_opening_7_5_2 = "5" 1.open1_mean_cat_all#11.week_from_opening_7_5_2  = "6" 1.open1_mean_cat_all#12.week_from_opening_7_5_2 = "7" 1.open1_mean_cat_all#13.week_from_opening_7_5_2 = "8" 1.open1_mean_cat_all#14.week_from_opening_7_5_2 = "9" 1.open1_mean_cat_all#15.week_from_opening_7_5_2 = "10" 1.open1_mean_cat_all#16.week_from_opening_7_5_2 = "11" 1.open1_mean_cat_all#17.week_from_opening_7_5_2 = "12" 1.open1_mean_cat_all#18.week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)


graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Overall - 210329.gph"
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Overall - 210329.jpg", as(jpg) name("Graph") quality(100)






**NE region
*running it once and saving the estimates as hybrid
reg cases_per_pop_log i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if region == 0, vce(cluster fips)

estimates store hybrid_NE

*running it again and saving the estimates as traditional
reg cases_per_pop_log i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if region == 0, vce(cluster fips)

estimates store traditional_NE

**PLOTTING THE COEFFICIENTS*****
coefplot (hybrid_NE, keep(1.open1_mean_cat_all#1.week_from_opening_7_5_2 1.open1_mean_cat_all#2.week_from_opening_7_5_2 1.open1_mean_cat_all#3.week_from_opening_7_5_2 1.open1_mean_cat_all#4.week_from_opening_7_5_2 1.open1_mean_cat_all#5.week_from_opening_7_5_2 1.open1_mean_cat_all#6.week_from_opening_7_5_2 1.open1_mean_cat_all#7.week_from_opening_7_5_2 1.open1_mean_cat_all#8.week_from_opening_7_5_2 1.open1_mean_cat_all#9.week_from_opening_7_5_2 1.open1_mean_cat_all#10.week_from_opening_7_5_2 1.open1_mean_cat_all#11.week_from_opening_7_5_2 1.open1_mean_cat_all#12.week_from_opening_7_5_2 1.open1_mean_cat_all#13.week_from_opening_7_5_2 1.open1_mean_cat_all#14.week_from_opening_7_5_2 1.open1_mean_cat_all#15.week_from_opening_7_5_2 1.open1_mean_cat_all#16.week_from_opening_7_5_2 1.open1_mean_cat_all#17.week_from_opening_7_5_2 1.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Hybrid) mlcolor(black))   (traditional_NE, keep(2.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Traditional) mlcolor(black)), yline(0, lcolor(black) lpattern(dash)) vertical rename(2.open1_mean_cat_all#1.week_from_opening_7_5_2 = 1.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 = 1.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 = 1.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 = 1.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 = 1.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 = 1.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 = 1.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 = 1.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 = 1.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 = 1.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 = 1.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 = 1.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 = 1.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 = 1.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 = 1.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 = 1.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 = 1.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2 = 1.open1_mean_cat_all#18.week_from_opening_7_5_2) coeflabels(1.open1_mean_cat_all#1.week_from_opening_7_5_2 = "-4" 1.open1_mean_cat_all#2.week_from_opening_7_5_2 = "-3" 1.open1_mean_cat_all#3.week_from_opening_7_5_2 = "-2" 1.open1_mean_cat_all#4.week_from_opening_7_5_2 = "-1" 1.open1_mean_cat_all#5.week_from_opening_7_5_2 = "0" 1.open1_mean_cat_all#6.week_from_opening_7_5_2 = "1" 1.open1_mean_cat_all#7.week_from_opening_7_5_2 = "2" 1.open1_mean_cat_all#8.week_from_opening_7_5_2 = "3" 1.open1_mean_cat_all#9.week_from_opening_7_5_2 = "4" 1.open1_mean_cat_all#10.week_from_opening_7_5_2 = "5" 1.open1_mean_cat_all#11.week_from_opening_7_5_2  = "6" 1.open1_mean_cat_all#12.week_from_opening_7_5_2 = "7" 1.open1_mean_cat_all#13.week_from_opening_7_5_2 = "8" 1.open1_mean_cat_all#14.week_from_opening_7_5_2 = "9" 1.open1_mean_cat_all#15.week_from_opening_7_5_2 = "10" 1.open1_mean_cat_all#16.week_from_opening_7_5_2 = "11" 1.open1_mean_cat_all#17.week_from_opening_7_5_2 = "12" 1.open1_mean_cat_all#18.week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)


graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - NE - 210329.gph"
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - NE - 210329.jpg", as(jpg) name("Graph") quality(100)







**W region
*running it once and saving the estimates as hybrid
reg cases_per_pop_log i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if region == 1, vce(cluster fips)

estimates store hybrid_W

*running it again and saving the estimates as traditional
reg cases_per_pop_log i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if region == 1, vce(cluster fips)

estimates store traditional_W

**PLOTTING THE COEFFICIENTS*****
coefplot (hybrid_W, keep(1.open1_mean_cat_all#1.week_from_opening_7_5_2 1.open1_mean_cat_all#2.week_from_opening_7_5_2 1.open1_mean_cat_all#3.week_from_opening_7_5_2 1.open1_mean_cat_all#4.week_from_opening_7_5_2 1.open1_mean_cat_all#5.week_from_opening_7_5_2 1.open1_mean_cat_all#6.week_from_opening_7_5_2 1.open1_mean_cat_all#7.week_from_opening_7_5_2 1.open1_mean_cat_all#8.week_from_opening_7_5_2 1.open1_mean_cat_all#9.week_from_opening_7_5_2 1.open1_mean_cat_all#10.week_from_opening_7_5_2 1.open1_mean_cat_all#11.week_from_opening_7_5_2 1.open1_mean_cat_all#12.week_from_opening_7_5_2 1.open1_mean_cat_all#13.week_from_opening_7_5_2 1.open1_mean_cat_all#14.week_from_opening_7_5_2 1.open1_mean_cat_all#15.week_from_opening_7_5_2 1.open1_mean_cat_all#16.week_from_opening_7_5_2 1.open1_mean_cat_all#17.week_from_opening_7_5_2 1.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Hybrid) mlcolor(black))   (traditional_W, keep(2.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Traditional) mlcolor(black)), yline(0, lcolor(black) lpattern(dash)) vertical rename(2.open1_mean_cat_all#1.week_from_opening_7_5_2 = 1.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 = 1.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 = 1.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 = 1.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 = 1.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 = 1.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 = 1.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 = 1.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 = 1.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 = 1.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 = 1.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 = 1.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 = 1.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 = 1.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 = 1.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 = 1.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 = 1.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2 = 1.open1_mean_cat_all#18.week_from_opening_7_5_2) coeflabels(1.open1_mean_cat_all#1.week_from_opening_7_5_2 = "-4" 1.open1_mean_cat_all#2.week_from_opening_7_5_2 = "-3" 1.open1_mean_cat_all#3.week_from_opening_7_5_2 = "-2" 1.open1_mean_cat_all#4.week_from_opening_7_5_2 = "-1" 1.open1_mean_cat_all#5.week_from_opening_7_5_2 = "0" 1.open1_mean_cat_all#6.week_from_opening_7_5_2 = "1" 1.open1_mean_cat_all#7.week_from_opening_7_5_2 = "2" 1.open1_mean_cat_all#8.week_from_opening_7_5_2 = "3" 1.open1_mean_cat_all#9.week_from_opening_7_5_2 = "4" 1.open1_mean_cat_all#10.week_from_opening_7_5_2 = "5" 1.open1_mean_cat_all#11.week_from_opening_7_5_2  = "6" 1.open1_mean_cat_all#12.week_from_opening_7_5_2 = "7" 1.open1_mean_cat_all#13.week_from_opening_7_5_2 = "8" 1.open1_mean_cat_all#14.week_from_opening_7_5_2 = "9" 1.open1_mean_cat_all#15.week_from_opening_7_5_2 = "10" 1.open1_mean_cat_all#16.week_from_opening_7_5_2 = "11" 1.open1_mean_cat_all#17.week_from_opening_7_5_2 = "12" 1.open1_mean_cat_all#18.week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)


graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - W - 210329.gph"
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - W - 210329.jpg", as(jpg) name("Graph") quality(100)







**MW region
*running it once and saving the estimates as hybrid
reg cases_per_pop_log i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if region == 2, vce(cluster fips)

estimates store hybrid_MW

*running it again and saving the estimates as traditional
reg cases_per_pop_log i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if region == 2, vce(cluster fips)

estimates store traditional_MW

**PLOTTING THE COEFFICIENTS*****
coefplot (hybrid_MW, keep(1.open1_mean_cat_all#1.week_from_opening_7_5_2 1.open1_mean_cat_all#2.week_from_opening_7_5_2 1.open1_mean_cat_all#3.week_from_opening_7_5_2 1.open1_mean_cat_all#4.week_from_opening_7_5_2 1.open1_mean_cat_all#5.week_from_opening_7_5_2 1.open1_mean_cat_all#6.week_from_opening_7_5_2 1.open1_mean_cat_all#7.week_from_opening_7_5_2 1.open1_mean_cat_all#8.week_from_opening_7_5_2 1.open1_mean_cat_all#9.week_from_opening_7_5_2 1.open1_mean_cat_all#10.week_from_opening_7_5_2 1.open1_mean_cat_all#11.week_from_opening_7_5_2 1.open1_mean_cat_all#12.week_from_opening_7_5_2 1.open1_mean_cat_all#13.week_from_opening_7_5_2 1.open1_mean_cat_all#14.week_from_opening_7_5_2 1.open1_mean_cat_all#15.week_from_opening_7_5_2 1.open1_mean_cat_all#16.week_from_opening_7_5_2 1.open1_mean_cat_all#17.week_from_opening_7_5_2 1.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Hybrid) mlcolor(black))   (traditional_MW, keep(2.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Traditional) mlcolor(black)), yline(0, lcolor(black) lpattern(dash)) vertical rename(2.open1_mean_cat_all#1.week_from_opening_7_5_2 = 1.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 = 1.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 = 1.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 = 1.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 = 1.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 = 1.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 = 1.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 = 1.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 = 1.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 = 1.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 = 1.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 = 1.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 = 1.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 = 1.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 = 1.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 = 1.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 = 1.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2 = 1.open1_mean_cat_all#18.week_from_opening_7_5_2) coeflabels(1.open1_mean_cat_all#1.week_from_opening_7_5_2 = "-4" 1.open1_mean_cat_all#2.week_from_opening_7_5_2 = "-3" 1.open1_mean_cat_all#3.week_from_opening_7_5_2 = "-2" 1.open1_mean_cat_all#4.week_from_opening_7_5_2 = "-1" 1.open1_mean_cat_all#5.week_from_opening_7_5_2 = "0" 1.open1_mean_cat_all#6.week_from_opening_7_5_2 = "1" 1.open1_mean_cat_all#7.week_from_opening_7_5_2 = "2" 1.open1_mean_cat_all#8.week_from_opening_7_5_2 = "3" 1.open1_mean_cat_all#9.week_from_opening_7_5_2 = "4" 1.open1_mean_cat_all#10.week_from_opening_7_5_2 = "5" 1.open1_mean_cat_all#11.week_from_opening_7_5_2  = "6" 1.open1_mean_cat_all#12.week_from_opening_7_5_2 = "7" 1.open1_mean_cat_all#13.week_from_opening_7_5_2 = "8" 1.open1_mean_cat_all#14.week_from_opening_7_5_2 = "9" 1.open1_mean_cat_all#15.week_from_opening_7_5_2 = "10" 1.open1_mean_cat_all#16.week_from_opening_7_5_2 = "11" 1.open1_mean_cat_all#17.week_from_opening_7_5_2 = "12" 1.open1_mean_cat_all#18.week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)


graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - MW - 210329.gph"
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - MW - 210329.jpg", as(jpg) name("Graph") quality(100)






**S region
*running it once and saving the estimates as hybrid
reg cases_per_pop_log i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if region == 3, vce(cluster fips)

estimates store hybrid_S

*running it again and saving the estimates as traditional
reg cases_per_pop_log i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if region == 3, vce(cluster fips)

estimates store traditional_S

**PLOTTING THE COEFFICIENTS*****
coefplot (hybrid_S, keep(1.open1_mean_cat_all#1.week_from_opening_7_5_2 1.open1_mean_cat_all#2.week_from_opening_7_5_2 1.open1_mean_cat_all#3.week_from_opening_7_5_2 1.open1_mean_cat_all#4.week_from_opening_7_5_2 1.open1_mean_cat_all#5.week_from_opening_7_5_2 1.open1_mean_cat_all#6.week_from_opening_7_5_2 1.open1_mean_cat_all#7.week_from_opening_7_5_2 1.open1_mean_cat_all#8.week_from_opening_7_5_2 1.open1_mean_cat_all#9.week_from_opening_7_5_2 1.open1_mean_cat_all#10.week_from_opening_7_5_2 1.open1_mean_cat_all#11.week_from_opening_7_5_2 1.open1_mean_cat_all#12.week_from_opening_7_5_2 1.open1_mean_cat_all#13.week_from_opening_7_5_2 1.open1_mean_cat_all#14.week_from_opening_7_5_2 1.open1_mean_cat_all#15.week_from_opening_7_5_2 1.open1_mean_cat_all#16.week_from_opening_7_5_2 1.open1_mean_cat_all#17.week_from_opening_7_5_2 1.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Hybrid) mlcolor(black))   (traditional_S, keep(2.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Traditional) mlcolor(black)), yline(0, lcolor(black) lpattern(dash)) vertical rename(2.open1_mean_cat_all#1.week_from_opening_7_5_2 = 1.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 = 1.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 = 1.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 = 1.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 = 1.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 = 1.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 = 1.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 = 1.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 = 1.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 = 1.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 = 1.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 = 1.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 = 1.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 = 1.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 = 1.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 = 1.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 = 1.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2 = 1.open1_mean_cat_all#18.week_from_opening_7_5_2) coeflabels(1.open1_mean_cat_all#1.week_from_opening_7_5_2 = "-4" 1.open1_mean_cat_all#2.week_from_opening_7_5_2 = "-3" 1.open1_mean_cat_all#3.week_from_opening_7_5_2 = "-2" 1.open1_mean_cat_all#4.week_from_opening_7_5_2 = "-1" 1.open1_mean_cat_all#5.week_from_opening_7_5_2 = "0" 1.open1_mean_cat_all#6.week_from_opening_7_5_2 = "1" 1.open1_mean_cat_all#7.week_from_opening_7_5_2 = "2" 1.open1_mean_cat_all#8.week_from_opening_7_5_2 = "3" 1.open1_mean_cat_all#9.week_from_opening_7_5_2 = "4" 1.open1_mean_cat_all#10.week_from_opening_7_5_2 = "5" 1.open1_mean_cat_all#11.week_from_opening_7_5_2  = "6" 1.open1_mean_cat_all#12.week_from_opening_7_5_2 = "7" 1.open1_mean_cat_all#13.week_from_opening_7_5_2 = "8" 1.open1_mean_cat_all#14.week_from_opening_7_5_2 = "9" 1.open1_mean_cat_all#15.week_from_opening_7_5_2 = "10" 1.open1_mean_cat_all#16.week_from_opening_7_5_2 = "11" 1.open1_mean_cat_all#17.week_from_opening_7_5_2 = "12" 1.open1_mean_cat_all#18.week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)


graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - S - 210329.gph"
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - S - 210329.jpg", as(jpg) name("Graph") quality(100)







*****************
****0-9 years****
*****************
generate cases_per_pop_0_9_log = log(all_cases_per_pop_0_9)

log using "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\COVID School Analyses - 0-9 years - 210411.smcl", replace

**overall
*running it once and saving the estimates as hybrid
reg cases_per_pop_0_9_log i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips, vce(cluster fips)

estimates store hybrid_overall_0_9

*running it again and saving the estimates as traditional
reg cases_per_pop_0_9_log i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips, vce(cluster fips)

estimates store traditional_overall_0_9

**PLOTTING THE COEFFICIENTS*****
coefplot (hybrid_overall_0_9, keep(1.open1_mean_cat_all#1.week_from_opening_7_5_2 1.open1_mean_cat_all#2.week_from_opening_7_5_2 1.open1_mean_cat_all#3.week_from_opening_7_5_2 1.open1_mean_cat_all#4.week_from_opening_7_5_2 1.open1_mean_cat_all#5.week_from_opening_7_5_2 1.open1_mean_cat_all#6.week_from_opening_7_5_2 1.open1_mean_cat_all#7.week_from_opening_7_5_2 1.open1_mean_cat_all#8.week_from_opening_7_5_2 1.open1_mean_cat_all#9.week_from_opening_7_5_2 1.open1_mean_cat_all#10.week_from_opening_7_5_2 1.open1_mean_cat_all#11.week_from_opening_7_5_2 1.open1_mean_cat_all#12.week_from_opening_7_5_2 1.open1_mean_cat_all#13.week_from_opening_7_5_2 1.open1_mean_cat_all#14.week_from_opening_7_5_2 1.open1_mean_cat_all#15.week_from_opening_7_5_2 1.open1_mean_cat_all#16.week_from_opening_7_5_2 1.open1_mean_cat_all#17.week_from_opening_7_5_2 1.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Hybrid) mlcolor(black) mcolor(gs12) ciopts(color(gs10)))   (traditional_overall_0_9, keep(2.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Traditional) mlcolor(black) mcolor(gs5) ciopts(color(gs5))), yline(0, lcolor(black) lpattern(dash)) ylabel(-0.5(0.5)1.25) yscale(range(-0.5(0.5)1.25)) vertical rename(2.open1_mean_cat_all#1.week_from_opening_7_5_2 = 1.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 = 1.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 = 1.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 = 1.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 = 1.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 = 1.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 = 1.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 = 1.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 = 1.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 = 1.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 = 1.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 = 1.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 = 1.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 = 1.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 = 1.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 = 1.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 = 1.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2 = 1.open1_mean_cat_all#18.week_from_opening_7_5_2) coeflabels(1.open1_mean_cat_all#1.week_from_opening_7_5_2 = "-4" 1.open1_mean_cat_all#2.week_from_opening_7_5_2 = "-3" 1.open1_mean_cat_all#3.week_from_opening_7_5_2 = "-2" 1.open1_mean_cat_all#4.week_from_opening_7_5_2 = "-1" 1.open1_mean_cat_all#5.week_from_opening_7_5_2 = "0" 1.open1_mean_cat_all#6.week_from_opening_7_5_2 = "1" 1.open1_mean_cat_all#7.week_from_opening_7_5_2 = "2" 1.open1_mean_cat_all#8.week_from_opening_7_5_2 = "3" 1.open1_mean_cat_all#9.week_from_opening_7_5_2 = "4" 1.open1_mean_cat_all#10.week_from_opening_7_5_2 = "5" 1.open1_mean_cat_all#11.week_from_opening_7_5_2  = "6" 1.open1_mean_cat_all#12.week_from_opening_7_5_2 = "7" 1.open1_mean_cat_all#13.week_from_opening_7_5_2 = "8" 1.open1_mean_cat_all#14.week_from_opening_7_5_2 = "9" 1.open1_mean_cat_all#15.week_from_opening_7_5_2 = "10" 1.open1_mean_cat_all#16.week_from_opening_7_5_2 = "11" 1.open1_mean_cat_all#17.week_from_opening_7_5_2 = "12" 1.open1_mean_cat_all#18.week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)

 
graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Overall - 0-9 years - 210412.gph", replace
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Overall - 0-9 years - 210412.jpg", as(jpg) name("Graph") quality(100) replace






**NE region
*running it once and saving the estimates as hybrid
reg cases_per_pop_0_9_log i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if region == 0, vce(cluster fips)

estimates store hybrid_NE_0_9

*running it again and saving the estimates as traditional
reg cases_per_pop_0_9_log i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if region == 0, vce(cluster fips)

estimates store traditional_NE_0_9

**PLOTTING THE COEFFICIENTS*****
coefplot (hybrid_NE_0_9, keep(1.open1_mean_cat_all#1.week_from_opening_7_5_2 1.open1_mean_cat_all#2.week_from_opening_7_5_2 1.open1_mean_cat_all#3.week_from_opening_7_5_2 1.open1_mean_cat_all#4.week_from_opening_7_5_2 1.open1_mean_cat_all#5.week_from_opening_7_5_2 1.open1_mean_cat_all#6.week_from_opening_7_5_2 1.open1_mean_cat_all#7.week_from_opening_7_5_2 1.open1_mean_cat_all#8.week_from_opening_7_5_2 1.open1_mean_cat_all#9.week_from_opening_7_5_2 1.open1_mean_cat_all#10.week_from_opening_7_5_2 1.open1_mean_cat_all#11.week_from_opening_7_5_2 1.open1_mean_cat_all#12.week_from_opening_7_5_2 1.open1_mean_cat_all#13.week_from_opening_7_5_2 1.open1_mean_cat_all#14.week_from_opening_7_5_2 1.open1_mean_cat_all#15.week_from_opening_7_5_2 1.open1_mean_cat_all#16.week_from_opening_7_5_2 1.open1_mean_cat_all#17.week_from_opening_7_5_2 1.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Hybrid) mlcolor(black) mcolor(gs12) ciopts(color(gs10)))   (traditional_NE_0_9, keep(2.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Traditional) mlcolor(black) mcolor(gs5) ciopts(color(gs5))), yline(0, lcolor(black) lpattern(dash)) ylabel(-1(0.5)1.5) yscale(range(-1(0.5)1.5)) vertical rename(2.open1_mean_cat_all#1.week_from_opening_7_5_2 = 1.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 = 1.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 = 1.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 = 1.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 = 1.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 = 1.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 = 1.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 = 1.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 = 1.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 = 1.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 = 1.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 = 1.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 = 1.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 = 1.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 = 1.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 = 1.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 = 1.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2 = 1.open1_mean_cat_all#18.week_from_opening_7_5_2) coeflabels(1.open1_mean_cat_all#1.week_from_opening_7_5_2 = "-4" 1.open1_mean_cat_all#2.week_from_opening_7_5_2 = "-3" 1.open1_mean_cat_all#3.week_from_opening_7_5_2 = "-2" 1.open1_mean_cat_all#4.week_from_opening_7_5_2 = "-1" 1.open1_mean_cat_all#5.week_from_opening_7_5_2 = "0" 1.open1_mean_cat_all#6.week_from_opening_7_5_2 = "1" 1.open1_mean_cat_all#7.week_from_opening_7_5_2 = "2" 1.open1_mean_cat_all#8.week_from_opening_7_5_2 = "3" 1.open1_mean_cat_all#9.week_from_opening_7_5_2 = "4" 1.open1_mean_cat_all#10.week_from_opening_7_5_2 = "5" 1.open1_mean_cat_all#11.week_from_opening_7_5_2  = "6" 1.open1_mean_cat_all#12.week_from_opening_7_5_2 = "7" 1.open1_mean_cat_all#13.week_from_opening_7_5_2 = "8" 1.open1_mean_cat_all#14.week_from_opening_7_5_2 = "9" 1.open1_mean_cat_all#15.week_from_opening_7_5_2 = "10" 1.open1_mean_cat_all#16.week_from_opening_7_5_2 = "11" 1.open1_mean_cat_all#17.week_from_opening_7_5_2 = "12" 1.open1_mean_cat_all#18.week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)


graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - NE - 0-9 years - 210412.gph", replace
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - NE - 0-9 years - 210412.jpg", as(jpg) name("Graph") quality(100) replace







**W region
*running it once and saving the estimates as hybrid
reg cases_per_pop_0_9_log i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if region == 1, vce(cluster fips)

estimates store hybrid_W_0_9

*running it again and saving the estimates as traditional
reg cases_per_pop_0_9_log i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if region == 1, vce(cluster fips)

estimates store traditional_W_0_9

**PLOTTING THE COEFFICIENTS*****
coefplot (hybrid_W_0_9, keep(1.open1_mean_cat_all#1.week_from_opening_7_5_2 1.open1_mean_cat_all#2.week_from_opening_7_5_2 1.open1_mean_cat_all#3.week_from_opening_7_5_2 1.open1_mean_cat_all#4.week_from_opening_7_5_2 1.open1_mean_cat_all#5.week_from_opening_7_5_2 1.open1_mean_cat_all#6.week_from_opening_7_5_2 1.open1_mean_cat_all#7.week_from_opening_7_5_2 1.open1_mean_cat_all#8.week_from_opening_7_5_2 1.open1_mean_cat_all#9.week_from_opening_7_5_2 1.open1_mean_cat_all#10.week_from_opening_7_5_2 1.open1_mean_cat_all#11.week_from_opening_7_5_2 1.open1_mean_cat_all#12.week_from_opening_7_5_2 1.open1_mean_cat_all#13.week_from_opening_7_5_2 1.open1_mean_cat_all#14.week_from_opening_7_5_2 1.open1_mean_cat_all#15.week_from_opening_7_5_2 1.open1_mean_cat_all#16.week_from_opening_7_5_2 1.open1_mean_cat_all#17.week_from_opening_7_5_2 1.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Hybrid) mlcolor(black) mcolor(gs12) ciopts(color(gs10)))   (traditional_W_0_9, keep(2.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Traditional) mlcolor(black) mcolor(gs5) ciopts(color(gs5))), yline(0, lcolor(black) lpattern(dash)) ylabel(-1(0.5)2.5) yscale(range(-1(0.5)2.5)) vertical rename(2.open1_mean_cat_all#1.week_from_opening_7_5_2 = 1.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 = 1.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 = 1.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 = 1.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 = 1.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 = 1.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 = 1.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 = 1.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 = 1.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 = 1.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 = 1.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 = 1.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 = 1.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 = 1.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 = 1.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 = 1.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 = 1.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2 = 1.open1_mean_cat_all#18.week_from_opening_7_5_2) coeflabels(1.open1_mean_cat_all#1.week_from_opening_7_5_2 = "-4" 1.open1_mean_cat_all#2.week_from_opening_7_5_2 = "-3" 1.open1_mean_cat_all#3.week_from_opening_7_5_2 = "-2" 1.open1_mean_cat_all#4.week_from_opening_7_5_2 = "-1" 1.open1_mean_cat_all#5.week_from_opening_7_5_2 = "0" 1.open1_mean_cat_all#6.week_from_opening_7_5_2 = "1" 1.open1_mean_cat_all#7.week_from_opening_7_5_2 = "2" 1.open1_mean_cat_all#8.week_from_opening_7_5_2 = "3" 1.open1_mean_cat_all#9.week_from_opening_7_5_2 = "4" 1.open1_mean_cat_all#10.week_from_opening_7_5_2 = "5" 1.open1_mean_cat_all#11.week_from_opening_7_5_2  = "6" 1.open1_mean_cat_all#12.week_from_opening_7_5_2 = "7" 1.open1_mean_cat_all#13.week_from_opening_7_5_2 = "8" 1.open1_mean_cat_all#14.week_from_opening_7_5_2 = "9" 1.open1_mean_cat_all#15.week_from_opening_7_5_2 = "10" 1.open1_mean_cat_all#16.week_from_opening_7_5_2 = "11" 1.open1_mean_cat_all#17.week_from_opening_7_5_2 = "12" 1.open1_mean_cat_all#18.week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)


graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - W - 0-9 years - 210412.gph", replace
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - W - 0-9 years - 210412.jpg", as(jpg) name("Graph") quality(100) replace







**MW region
*running it once and saving the estimates as hybrid
reg cases_per_pop_0_9_log i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if region == 2, vce(cluster fips)

estimates store hybrid_MW_0_9

*running it again and saving the estimates as traditional
reg cases_per_pop_0_9_log i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if region == 2, vce(cluster fips)

estimates store traditional_MW_0_9

**PLOTTING THE COEFFICIENTS*****
coefplot (hybrid_MW_0_9, keep(1.open1_mean_cat_all#1.week_from_opening_7_5_2 1.open1_mean_cat_all#2.week_from_opening_7_5_2 1.open1_mean_cat_all#3.week_from_opening_7_5_2 1.open1_mean_cat_all#4.week_from_opening_7_5_2 1.open1_mean_cat_all#5.week_from_opening_7_5_2 1.open1_mean_cat_all#6.week_from_opening_7_5_2 1.open1_mean_cat_all#7.week_from_opening_7_5_2 1.open1_mean_cat_all#8.week_from_opening_7_5_2 1.open1_mean_cat_all#9.week_from_opening_7_5_2 1.open1_mean_cat_all#10.week_from_opening_7_5_2 1.open1_mean_cat_all#11.week_from_opening_7_5_2 1.open1_mean_cat_all#12.week_from_opening_7_5_2 1.open1_mean_cat_all#13.week_from_opening_7_5_2 1.open1_mean_cat_all#14.week_from_opening_7_5_2 1.open1_mean_cat_all#15.week_from_opening_7_5_2 1.open1_mean_cat_all#16.week_from_opening_7_5_2 1.open1_mean_cat_all#17.week_from_opening_7_5_2 1.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Hybrid) mlcolor(black) mcolor(gs12) ciopts(color(gs10)))   (traditional_MW_0_9, keep(2.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Traditional) mlcolor(black) mcolor(gs5) ciopts(color(gs5))), yline(0, lcolor(black) lpattern(dash)) ylabel(-2(0.5)1) yscale(range(-2(0.5)1)) vertical rename(2.open1_mean_cat_all#1.week_from_opening_7_5_2 = 1.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 = 1.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 = 1.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 = 1.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 = 1.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 = 1.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 = 1.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 = 1.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 = 1.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 = 1.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 = 1.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 = 1.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 = 1.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 = 1.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 = 1.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 = 1.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 = 1.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2 = 1.open1_mean_cat_all#18.week_from_opening_7_5_2) coeflabels(1.open1_mean_cat_all#1.week_from_opening_7_5_2 = "-4" 1.open1_mean_cat_all#2.week_from_opening_7_5_2 = "-3" 1.open1_mean_cat_all#3.week_from_opening_7_5_2 = "-2" 1.open1_mean_cat_all#4.week_from_opening_7_5_2 = "-1" 1.open1_mean_cat_all#5.week_from_opening_7_5_2 = "0" 1.open1_mean_cat_all#6.week_from_opening_7_5_2 = "1" 1.open1_mean_cat_all#7.week_from_opening_7_5_2 = "2" 1.open1_mean_cat_all#8.week_from_opening_7_5_2 = "3" 1.open1_mean_cat_all#9.week_from_opening_7_5_2 = "4" 1.open1_mean_cat_all#10.week_from_opening_7_5_2 = "5" 1.open1_mean_cat_all#11.week_from_opening_7_5_2  = "6" 1.open1_mean_cat_all#12.week_from_opening_7_5_2 = "7" 1.open1_mean_cat_all#13.week_from_opening_7_5_2 = "8" 1.open1_mean_cat_all#14.week_from_opening_7_5_2 = "9" 1.open1_mean_cat_all#15.week_from_opening_7_5_2 = "10" 1.open1_mean_cat_all#16.week_from_opening_7_5_2 = "11" 1.open1_mean_cat_all#17.week_from_opening_7_5_2 = "12" 1.open1_mean_cat_all#18.week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)


graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - MW - 0-9 years - 210412.gph", replace
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - MW - 0-9 years - 210412.jpg", as(jpg) name("Graph") quality(100) replace






**S region
*running it once and saving the estimates as hybrid
reg cases_per_pop_0_9_log i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if region == 3, vce(cluster fips)

estimates store hybrid_S_0_9

*running it again and saving the estimates as traditional
reg cases_per_pop_0_9_log i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if region == 3, vce(cluster fips)

estimates store traditional_S_0_9

**PLOTTING THE COEFFICIENTS*****
coefplot (hybrid_S_0_9, keep(1.open1_mean_cat_all#1.week_from_opening_7_5_2 1.open1_mean_cat_all#2.week_from_opening_7_5_2 1.open1_mean_cat_all#3.week_from_opening_7_5_2 1.open1_mean_cat_all#4.week_from_opening_7_5_2 1.open1_mean_cat_all#5.week_from_opening_7_5_2 1.open1_mean_cat_all#6.week_from_opening_7_5_2 1.open1_mean_cat_all#7.week_from_opening_7_5_2 1.open1_mean_cat_all#8.week_from_opening_7_5_2 1.open1_mean_cat_all#9.week_from_opening_7_5_2 1.open1_mean_cat_all#10.week_from_opening_7_5_2 1.open1_mean_cat_all#11.week_from_opening_7_5_2 1.open1_mean_cat_all#12.week_from_opening_7_5_2 1.open1_mean_cat_all#13.week_from_opening_7_5_2 1.open1_mean_cat_all#14.week_from_opening_7_5_2 1.open1_mean_cat_all#15.week_from_opening_7_5_2 1.open1_mean_cat_all#16.week_from_opening_7_5_2 1.open1_mean_cat_all#17.week_from_opening_7_5_2 1.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Hybrid) mlcolor(black) mcolor(gs12) ciopts(color(gs10)))   (traditional_S_0_9, keep(2.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Traditional) mlcolor(black) mcolor(gs5) ciopts(color(gs5))), yline(0, lcolor(black) lpattern(dash)) ylabel(-1(0.5)1) yscale(range(-1(0.5)1)) vertical rename(2.open1_mean_cat_all#1.week_from_opening_7_5_2 = 1.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 = 1.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 = 1.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 = 1.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 = 1.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 = 1.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 = 1.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 = 1.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 = 1.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 = 1.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 = 1.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 = 1.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 = 1.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 = 1.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 = 1.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 = 1.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 = 1.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2 = 1.open1_mean_cat_all#18.week_from_opening_7_5_2) coeflabels(1.open1_mean_cat_all#1.week_from_opening_7_5_2 = "-4" 1.open1_mean_cat_all#2.week_from_opening_7_5_2 = "-3" 1.open1_mean_cat_all#3.week_from_opening_7_5_2 = "-2" 1.open1_mean_cat_all#4.week_from_opening_7_5_2 = "-1" 1.open1_mean_cat_all#5.week_from_opening_7_5_2 = "0" 1.open1_mean_cat_all#6.week_from_opening_7_5_2 = "1" 1.open1_mean_cat_all#7.week_from_opening_7_5_2 = "2" 1.open1_mean_cat_all#8.week_from_opening_7_5_2 = "3" 1.open1_mean_cat_all#9.week_from_opening_7_5_2 = "4" 1.open1_mean_cat_all#10.week_from_opening_7_5_2 = "5" 1.open1_mean_cat_all#11.week_from_opening_7_5_2  = "6" 1.open1_mean_cat_all#12.week_from_opening_7_5_2 = "7" 1.open1_mean_cat_all#13.week_from_opening_7_5_2 = "8" 1.open1_mean_cat_all#14.week_from_opening_7_5_2 = "9" 1.open1_mean_cat_all#15.week_from_opening_7_5_2 = "10" 1.open1_mean_cat_all#16.week_from_opening_7_5_2 = "11" 1.open1_mean_cat_all#17.week_from_opening_7_5_2 = "12" 1.open1_mean_cat_all#18.week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)



graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - S - 0-9 years - 210412.gph", replace
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - S - 0-9 years - 210412.jpg", as(jpg) name("Graph") quality(100) replace




log close




*****************
****10-19 years****
*****************
generate cases_per_pop_10_19_log = log(all_cases_per_pop_10_19)

**overall
*running it once and saving the estimates as hybrid
reg cases_per_pop_10_19_log i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips, vce(cluster fips)

estimates store hybrid_overall_10_19

*running it again and saving the estimates as traditional
reg cases_per_pop_10_19_log i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips, vce(cluster fips)

estimates store traditional_overall_10_19

**PLOTTING THE COEFFICIENTS*****
coefplot (hybrid_overall_10_19, keep(1.open1_mean_cat_all#1.week_from_opening_7_5_2 1.open1_mean_cat_all#2.week_from_opening_7_5_2 1.open1_mean_cat_all#3.week_from_opening_7_5_2 1.open1_mean_cat_all#4.week_from_opening_7_5_2 1.open1_mean_cat_all#5.week_from_opening_7_5_2 1.open1_mean_cat_all#6.week_from_opening_7_5_2 1.open1_mean_cat_all#7.week_from_opening_7_5_2 1.open1_mean_cat_all#8.week_from_opening_7_5_2 1.open1_mean_cat_all#9.week_from_opening_7_5_2 1.open1_mean_cat_all#10.week_from_opening_7_5_2 1.open1_mean_cat_all#11.week_from_opening_7_5_2 1.open1_mean_cat_all#12.week_from_opening_7_5_2 1.open1_mean_cat_all#13.week_from_opening_7_5_2 1.open1_mean_cat_all#14.week_from_opening_7_5_2 1.open1_mean_cat_all#15.week_from_opening_7_5_2 1.open1_mean_cat_all#16.week_from_opening_7_5_2 1.open1_mean_cat_all#17.week_from_opening_7_5_2 1.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Hybrid) mlcolor(black) mcolor(gs12) ciopts(color(gs10)))   (traditional_overall_10_19, keep(2.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Traditional) mlcolor(black) mcolor(gs5) ciopts(color(gs5))), yline(0, lcolor(black) lpattern(dash)) ylabel(-0.5(0.5)1) yscale(range(-0.5(0.5)1)) vertical rename(2.open1_mean_cat_all#1.week_from_opening_7_5_2 = 1.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 = 1.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 = 1.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 = 1.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 = 1.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 = 1.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 = 1.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 = 1.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 = 1.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 = 1.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 = 1.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 = 1.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 = 1.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 = 1.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 = 1.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 = 1.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 = 1.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2 = 1.open1_mean_cat_all#18.week_from_opening_7_5_2) coeflabels(1.open1_mean_cat_all#1.week_from_opening_7_5_2 = "-4" 1.open1_mean_cat_all#2.week_from_opening_7_5_2 = "-3" 1.open1_mean_cat_all#3.week_from_opening_7_5_2 = "-2" 1.open1_mean_cat_all#4.week_from_opening_7_5_2 = "-1" 1.open1_mean_cat_all#5.week_from_opening_7_5_2 = "0" 1.open1_mean_cat_all#6.week_from_opening_7_5_2 = "1" 1.open1_mean_cat_all#7.week_from_opening_7_5_2 = "2" 1.open1_mean_cat_all#8.week_from_opening_7_5_2 = "3" 1.open1_mean_cat_all#9.week_from_opening_7_5_2 = "4" 1.open1_mean_cat_all#10.week_from_opening_7_5_2 = "5" 1.open1_mean_cat_all#11.week_from_opening_7_5_2  = "6" 1.open1_mean_cat_all#12.week_from_opening_7_5_2 = "7" 1.open1_mean_cat_all#13.week_from_opening_7_5_2 = "8" 1.open1_mean_cat_all#14.week_from_opening_7_5_2 = "9" 1.open1_mean_cat_all#15.week_from_opening_7_5_2 = "10" 1.open1_mean_cat_all#16.week_from_opening_7_5_2 = "11" 1.open1_mean_cat_all#17.week_from_opening_7_5_2 = "12" 1.open1_mean_cat_all#18.week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)

graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Overall - 10-19 years - 210412.gph", replace
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Overall - 10-19 years - 210412.jpg", as(jpg) name("Graph") quality(100) replace






**NE region
*running it once and saving the estimates as hybrid
reg cases_per_pop_10_19_log i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if region == 0, vce(cluster fips)

estimates store hybrid_NE_10_19

*running it again and saving the estimates as traditional
reg cases_per_pop_10_19_log i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if region == 0, vce(cluster fips)

estimates store traditional_NE_10_19

**PLOTTING THE COEFFICIENTS*****
coefplot (hybrid_NE_10_19, keep(1.open1_mean_cat_all#1.week_from_opening_7_5_2 1.open1_mean_cat_all#2.week_from_opening_7_5_2 1.open1_mean_cat_all#3.week_from_opening_7_5_2 1.open1_mean_cat_all#4.week_from_opening_7_5_2 1.open1_mean_cat_all#5.week_from_opening_7_5_2 1.open1_mean_cat_all#6.week_from_opening_7_5_2 1.open1_mean_cat_all#7.week_from_opening_7_5_2 1.open1_mean_cat_all#8.week_from_opening_7_5_2 1.open1_mean_cat_all#9.week_from_opening_7_5_2 1.open1_mean_cat_all#10.week_from_opening_7_5_2 1.open1_mean_cat_all#11.week_from_opening_7_5_2 1.open1_mean_cat_all#12.week_from_opening_7_5_2 1.open1_mean_cat_all#13.week_from_opening_7_5_2 1.open1_mean_cat_all#14.week_from_opening_7_5_2 1.open1_mean_cat_all#15.week_from_opening_7_5_2 1.open1_mean_cat_all#16.week_from_opening_7_5_2 1.open1_mean_cat_all#17.week_from_opening_7_5_2 1.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Hybrid) mlcolor(black) mcolor(gs12) ciopts(color(gs10)))   (traditional_NE_10_19, keep(2.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Traditional) mlcolor(black) mcolor(gs5) ciopts(color(gs5))), yline(0, lcolor(black) lpattern(dash)) ylabel(-1(0.5)1.5) yscale(range(-1(0.5)1.5)) vertical rename(2.open1_mean_cat_all#1.week_from_opening_7_5_2 = 1.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 = 1.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 = 1.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 = 1.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 = 1.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 = 1.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 = 1.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 = 1.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 = 1.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 = 1.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 = 1.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 = 1.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 = 1.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 = 1.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 = 1.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 = 1.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 = 1.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2 = 1.open1_mean_cat_all#18.week_from_opening_7_5_2) coeflabels(1.open1_mean_cat_all#1.week_from_opening_7_5_2 = "-4" 1.open1_mean_cat_all#2.week_from_opening_7_5_2 = "-3" 1.open1_mean_cat_all#3.week_from_opening_7_5_2 = "-2" 1.open1_mean_cat_all#4.week_from_opening_7_5_2 = "-1" 1.open1_mean_cat_all#5.week_from_opening_7_5_2 = "0" 1.open1_mean_cat_all#6.week_from_opening_7_5_2 = "1" 1.open1_mean_cat_all#7.week_from_opening_7_5_2 = "2" 1.open1_mean_cat_all#8.week_from_opening_7_5_2 = "3" 1.open1_mean_cat_all#9.week_from_opening_7_5_2 = "4" 1.open1_mean_cat_all#10.week_from_opening_7_5_2 = "5" 1.open1_mean_cat_all#11.week_from_opening_7_5_2  = "6" 1.open1_mean_cat_all#12.week_from_opening_7_5_2 = "7" 1.open1_mean_cat_all#13.week_from_opening_7_5_2 = "8" 1.open1_mean_cat_all#14.week_from_opening_7_5_2 = "9" 1.open1_mean_cat_all#15.week_from_opening_7_5_2 = "10" 1.open1_mean_cat_all#16.week_from_opening_7_5_2 = "11" 1.open1_mean_cat_all#17.week_from_opening_7_5_2 = "12" 1.open1_mean_cat_all#18.week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)



graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - NE - 10-19 years - 210412.gph", replace
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - NE - 10-19 years - 210412.jpg", as(jpg) name("Graph") quality(100) replace







**W region
*running it once and saving the estimates as hybrid
reg cases_per_pop_10_19_log i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if region == 1, vce(cluster fips)

estimates store hybrid_W_10_19

*running it again and saving the estimates as traditional
reg cases_per_pop_10_19_log i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if region == 1, vce(cluster fips)

estimates store traditional_W_10_19

**PLOTTING THE COEFFICIENTS*****
coefplot (hybrid_W_10_19, keep(1.open1_mean_cat_all#1.week_from_opening_7_5_2 1.open1_mean_cat_all#2.week_from_opening_7_5_2 1.open1_mean_cat_all#3.week_from_opening_7_5_2 1.open1_mean_cat_all#4.week_from_opening_7_5_2 1.open1_mean_cat_all#5.week_from_opening_7_5_2 1.open1_mean_cat_all#6.week_from_opening_7_5_2 1.open1_mean_cat_all#7.week_from_opening_7_5_2 1.open1_mean_cat_all#8.week_from_opening_7_5_2 1.open1_mean_cat_all#9.week_from_opening_7_5_2 1.open1_mean_cat_all#10.week_from_opening_7_5_2 1.open1_mean_cat_all#11.week_from_opening_7_5_2 1.open1_mean_cat_all#12.week_from_opening_7_5_2 1.open1_mean_cat_all#13.week_from_opening_7_5_2 1.open1_mean_cat_all#14.week_from_opening_7_5_2 1.open1_mean_cat_all#15.week_from_opening_7_5_2 1.open1_mean_cat_all#16.week_from_opening_7_5_2 1.open1_mean_cat_all#17.week_from_opening_7_5_2 1.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Hybrid) mlcolor(black) mcolor(gs12) ciopts(color(gs10)))   (traditional_W_10_19, keep(2.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Traditional) mlcolor(black) mcolor(gs5) ciopts(color(gs5))), yline(0, lcolor(black) lpattern(dash)) ylabel(-1(0.5)2.5) yscale(range(-1(0.5)2.5)) vertical rename(2.open1_mean_cat_all#1.week_from_opening_7_5_2 = 1.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 = 1.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 = 1.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 = 1.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 = 1.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 = 1.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 = 1.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 = 1.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 = 1.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 = 1.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 = 1.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 = 1.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 = 1.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 = 1.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 = 1.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 = 1.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 = 1.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2 = 1.open1_mean_cat_all#18.week_from_opening_7_5_2) coeflabels(1.open1_mean_cat_all#1.week_from_opening_7_5_2 = "-4" 1.open1_mean_cat_all#2.week_from_opening_7_5_2 = "-3" 1.open1_mean_cat_all#3.week_from_opening_7_5_2 = "-2" 1.open1_mean_cat_all#4.week_from_opening_7_5_2 = "-1" 1.open1_mean_cat_all#5.week_from_opening_7_5_2 = "0" 1.open1_mean_cat_all#6.week_from_opening_7_5_2 = "1" 1.open1_mean_cat_all#7.week_from_opening_7_5_2 = "2" 1.open1_mean_cat_all#8.week_from_opening_7_5_2 = "3" 1.open1_mean_cat_all#9.week_from_opening_7_5_2 = "4" 1.open1_mean_cat_all#10.week_from_opening_7_5_2 = "5" 1.open1_mean_cat_all#11.week_from_opening_7_5_2  = "6" 1.open1_mean_cat_all#12.week_from_opening_7_5_2 = "7" 1.open1_mean_cat_all#13.week_from_opening_7_5_2 = "8" 1.open1_mean_cat_all#14.week_from_opening_7_5_2 = "9" 1.open1_mean_cat_all#15.week_from_opening_7_5_2 = "10" 1.open1_mean_cat_all#16.week_from_opening_7_5_2 = "11" 1.open1_mean_cat_all#17.week_from_opening_7_5_2 = "12" 1.open1_mean_cat_all#18.week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)

graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - W - 10-19 years - 210412.gph", replace
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - W - 10-19 years - 210412.jpg", as(jpg) name("Graph") quality(100) replace







**MW region
*running it once and saving the estimates as hybrid
reg cases_per_pop_10_19_log i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if region == 2, vce(cluster fips)

estimates store hybrid_MW_10_19

*running it again and saving the estimates as traditional
reg cases_per_pop_10_19_log i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if region == 2, vce(cluster fips)

estimates store traditional_MW_10_19

**PLOTTING THE COEFFICIENTS*****
coefplot (hybrid_MW_10_19, keep(1.open1_mean_cat_all#1.week_from_opening_7_5_2 1.open1_mean_cat_all#2.week_from_opening_7_5_2 1.open1_mean_cat_all#3.week_from_opening_7_5_2 1.open1_mean_cat_all#4.week_from_opening_7_5_2 1.open1_mean_cat_all#5.week_from_opening_7_5_2 1.open1_mean_cat_all#6.week_from_opening_7_5_2 1.open1_mean_cat_all#7.week_from_opening_7_5_2 1.open1_mean_cat_all#8.week_from_opening_7_5_2 1.open1_mean_cat_all#9.week_from_opening_7_5_2 1.open1_mean_cat_all#10.week_from_opening_7_5_2 1.open1_mean_cat_all#11.week_from_opening_7_5_2 1.open1_mean_cat_all#12.week_from_opening_7_5_2 1.open1_mean_cat_all#13.week_from_opening_7_5_2 1.open1_mean_cat_all#14.week_from_opening_7_5_2 1.open1_mean_cat_all#15.week_from_opening_7_5_2 1.open1_mean_cat_all#16.week_from_opening_7_5_2 1.open1_mean_cat_all#17.week_from_opening_7_5_2 1.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Hybrid) mlcolor(black) mcolor(gs12) ciopts(color(gs10)))   (traditional_MW_10_19, keep(2.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Traditional) mlcolor(black) mcolor(gs5) ciopts(color(gs5))), yline(0, lcolor(black) lpattern(dash)) ylabel(-2(0.5)1) yscale(range(-2(0.5)1)) vertical rename(2.open1_mean_cat_all#1.week_from_opening_7_5_2 = 1.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 = 1.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 = 1.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 = 1.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 = 1.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 = 1.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 = 1.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 = 1.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 = 1.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 = 1.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 = 1.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 = 1.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 = 1.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 = 1.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 = 1.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 = 1.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 = 1.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2 = 1.open1_mean_cat_all#18.week_from_opening_7_5_2) coeflabels(1.open1_mean_cat_all#1.week_from_opening_7_5_2 = "-4" 1.open1_mean_cat_all#2.week_from_opening_7_5_2 = "-3" 1.open1_mean_cat_all#3.week_from_opening_7_5_2 = "-2" 1.open1_mean_cat_all#4.week_from_opening_7_5_2 = "-1" 1.open1_mean_cat_all#5.week_from_opening_7_5_2 = "0" 1.open1_mean_cat_all#6.week_from_opening_7_5_2 = "1" 1.open1_mean_cat_all#7.week_from_opening_7_5_2 = "2" 1.open1_mean_cat_all#8.week_from_opening_7_5_2 = "3" 1.open1_mean_cat_all#9.week_from_opening_7_5_2 = "4" 1.open1_mean_cat_all#10.week_from_opening_7_5_2 = "5" 1.open1_mean_cat_all#11.week_from_opening_7_5_2  = "6" 1.open1_mean_cat_all#12.week_from_opening_7_5_2 = "7" 1.open1_mean_cat_all#13.week_from_opening_7_5_2 = "8" 1.open1_mean_cat_all#14.week_from_opening_7_5_2 = "9" 1.open1_mean_cat_all#15.week_from_opening_7_5_2 = "10" 1.open1_mean_cat_all#16.week_from_opening_7_5_2 = "11" 1.open1_mean_cat_all#17.week_from_opening_7_5_2 = "12" 1.open1_mean_cat_all#18.week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)



graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - MW - 10-19 years - 210412.gph", replace
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - MW - 10-19 years - 210412.jpg", as(jpg) name("Graph") quality(100) replace






**S region
*running it once and saving the estimates as hybrid
reg cases_per_pop_10_19_log i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if region == 3, vce(cluster fips)

estimates store hybrid_S_10_19

*running it again and saving the estimates as traditional
reg cases_per_pop_10_19_log i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if region == 3, vce(cluster fips)

estimates store traditional_S_10_19

**PLOTTING THE COEFFICIENTS*****
coefplot (hybrid_S_10_19, keep(1.open1_mean_cat_all#1.week_from_opening_7_5_2 1.open1_mean_cat_all#2.week_from_opening_7_5_2 1.open1_mean_cat_all#3.week_from_opening_7_5_2 1.open1_mean_cat_all#4.week_from_opening_7_5_2 1.open1_mean_cat_all#5.week_from_opening_7_5_2 1.open1_mean_cat_all#6.week_from_opening_7_5_2 1.open1_mean_cat_all#7.week_from_opening_7_5_2 1.open1_mean_cat_all#8.week_from_opening_7_5_2 1.open1_mean_cat_all#9.week_from_opening_7_5_2 1.open1_mean_cat_all#10.week_from_opening_7_5_2 1.open1_mean_cat_all#11.week_from_opening_7_5_2 1.open1_mean_cat_all#12.week_from_opening_7_5_2 1.open1_mean_cat_all#13.week_from_opening_7_5_2 1.open1_mean_cat_all#14.week_from_opening_7_5_2 1.open1_mean_cat_all#15.week_from_opening_7_5_2 1.open1_mean_cat_all#16.week_from_opening_7_5_2 1.open1_mean_cat_all#17.week_from_opening_7_5_2 1.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Hybrid) mlcolor(black) mcolor(gs12) ciopts(color(gs10)))   (traditional_S_10_19, keep(2.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Traditional) mlcolor(black) mcolor(gs5) ciopts(color(gs5))), yline(0, lcolor(black) lpattern(dash)) ylabel(-1(0.5)1) yscale(range(-1(0.5)1)) vertical rename(2.open1_mean_cat_all#1.week_from_opening_7_5_2 = 1.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 = 1.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 = 1.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 = 1.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 = 1.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 = 1.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 = 1.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 = 1.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 = 1.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 = 1.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 = 1.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 = 1.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 = 1.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 = 1.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 = 1.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 = 1.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 = 1.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2 = 1.open1_mean_cat_all#18.week_from_opening_7_5_2) coeflabels(1.open1_mean_cat_all#1.week_from_opening_7_5_2 = "-4" 1.open1_mean_cat_all#2.week_from_opening_7_5_2 = "-3" 1.open1_mean_cat_all#3.week_from_opening_7_5_2 = "-2" 1.open1_mean_cat_all#4.week_from_opening_7_5_2 = "-1" 1.open1_mean_cat_all#5.week_from_opening_7_5_2 = "0" 1.open1_mean_cat_all#6.week_from_opening_7_5_2 = "1" 1.open1_mean_cat_all#7.week_from_opening_7_5_2 = "2" 1.open1_mean_cat_all#8.week_from_opening_7_5_2 = "3" 1.open1_mean_cat_all#9.week_from_opening_7_5_2 = "4" 1.open1_mean_cat_all#10.week_from_opening_7_5_2 = "5" 1.open1_mean_cat_all#11.week_from_opening_7_5_2  = "6" 1.open1_mean_cat_all#12.week_from_opening_7_5_2 = "7" 1.open1_mean_cat_all#13.week_from_opening_7_5_2 = "8" 1.open1_mean_cat_all#14.week_from_opening_7_5_2 = "9" 1.open1_mean_cat_all#15.week_from_opening_7_5_2 = "10" 1.open1_mean_cat_all#16.week_from_opening_7_5_2 = "11" 1.open1_mean_cat_all#17.week_from_opening_7_5_2 = "12" 1.open1_mean_cat_all#18.week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)


graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - S - 10-19 years - 210412.gph", replace
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - S - 10-19 years - 210412.jpg", as(jpg) name("Graph") quality(100) replace







*****************
****20+ years****
*****************
generate cases_per_pop_20_log = log(all_cases_per_pop_20)

**overall
*running it once and saving the estimates as hybrid
reg cases_per_pop_20_log i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips, vce(cluster fips)

estimates store hybrid_overall_20

*running it again and saving the estimates as traditional
reg cases_per_pop_20_log i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips, vce(cluster fips)

estimates store traditional_overall_20

**PLOTTING THE COEFFICIENTS*****
coefplot (hybrid_overall_20, keep(1.open1_mean_cat_all#1.week_from_opening_7_5_2 1.open1_mean_cat_all#2.week_from_opening_7_5_2 1.open1_mean_cat_all#3.week_from_opening_7_5_2 1.open1_mean_cat_all#4.week_from_opening_7_5_2 1.open1_mean_cat_all#5.week_from_opening_7_5_2 1.open1_mean_cat_all#6.week_from_opening_7_5_2 1.open1_mean_cat_all#7.week_from_opening_7_5_2 1.open1_mean_cat_all#8.week_from_opening_7_5_2 1.open1_mean_cat_all#9.week_from_opening_7_5_2 1.open1_mean_cat_all#10.week_from_opening_7_5_2 1.open1_mean_cat_all#11.week_from_opening_7_5_2 1.open1_mean_cat_all#12.week_from_opening_7_5_2 1.open1_mean_cat_all#13.week_from_opening_7_5_2 1.open1_mean_cat_all#14.week_from_opening_7_5_2 1.open1_mean_cat_all#15.week_from_opening_7_5_2 1.open1_mean_cat_all#16.week_from_opening_7_5_2 1.open1_mean_cat_all#17.week_from_opening_7_5_2 1.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Hybrid) mlcolor(black) mcolor(gs12) ciopts(color(gs10)))   (traditional_overall_20, keep(2.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Traditional) mlcolor(black) mcolor(gs5) ciopts(color(gs5))), yline(0, lcolor(black) lpattern(dash)) ylabel(-0.5(0.5)1) yscale(range(-0.5(0.5)1)) vertical rename(2.open1_mean_cat_all#1.week_from_opening_7_5_2 = 1.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 = 1.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 = 1.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 = 1.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 = 1.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 = 1.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 = 1.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 = 1.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 = 1.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 = 1.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 = 1.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 = 1.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 = 1.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 = 1.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 = 1.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 = 1.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 = 1.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2 = 1.open1_mean_cat_all#18.week_from_opening_7_5_2) coeflabels(1.open1_mean_cat_all#1.week_from_opening_7_5_2 = "-4" 1.open1_mean_cat_all#2.week_from_opening_7_5_2 = "-3" 1.open1_mean_cat_all#3.week_from_opening_7_5_2 = "-2" 1.open1_mean_cat_all#4.week_from_opening_7_5_2 = "-1" 1.open1_mean_cat_all#5.week_from_opening_7_5_2 = "0" 1.open1_mean_cat_all#6.week_from_opening_7_5_2 = "1" 1.open1_mean_cat_all#7.week_from_opening_7_5_2 = "2" 1.open1_mean_cat_all#8.week_from_opening_7_5_2 = "3" 1.open1_mean_cat_all#9.week_from_opening_7_5_2 = "4" 1.open1_mean_cat_all#10.week_from_opening_7_5_2 = "5" 1.open1_mean_cat_all#11.week_from_opening_7_5_2  = "6" 1.open1_mean_cat_all#12.week_from_opening_7_5_2 = "7" 1.open1_mean_cat_all#13.week_from_opening_7_5_2 = "8" 1.open1_mean_cat_all#14.week_from_opening_7_5_2 = "9" 1.open1_mean_cat_all#15.week_from_opening_7_5_2 = "10" 1.open1_mean_cat_all#16.week_from_opening_7_5_2 = "11" 1.open1_mean_cat_all#17.week_from_opening_7_5_2 = "12" 1.open1_mean_cat_all#18.week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)


graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Overall - 20+ years - 210412.gph", replace
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Overall - 20+ years - 210412.jpg", as(jpg) name("Graph") quality(100) replace






**NE region
*running it once and saving the estimates as hybrid
reg cases_per_pop_20_log i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if region == 0, vce(cluster fips)

estimates store hybrid_NE_20

*running it again and saving the estimates as traditional
reg cases_per_pop_20_log i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if region == 0, vce(cluster fips)

estimates store traditional_NE_20

**PLOTTING THE COEFFICIENTS*****
coefplot (hybrid_NE_20, keep(1.open1_mean_cat_all#1.week_from_opening_7_5_2 1.open1_mean_cat_all#2.week_from_opening_7_5_2 1.open1_mean_cat_all#3.week_from_opening_7_5_2 1.open1_mean_cat_all#4.week_from_opening_7_5_2 1.open1_mean_cat_all#5.week_from_opening_7_5_2 1.open1_mean_cat_all#6.week_from_opening_7_5_2 1.open1_mean_cat_all#7.week_from_opening_7_5_2 1.open1_mean_cat_all#8.week_from_opening_7_5_2 1.open1_mean_cat_all#9.week_from_opening_7_5_2 1.open1_mean_cat_all#10.week_from_opening_7_5_2 1.open1_mean_cat_all#11.week_from_opening_7_5_2 1.open1_mean_cat_all#12.week_from_opening_7_5_2 1.open1_mean_cat_all#13.week_from_opening_7_5_2 1.open1_mean_cat_all#14.week_from_opening_7_5_2 1.open1_mean_cat_all#15.week_from_opening_7_5_2 1.open1_mean_cat_all#16.week_from_opening_7_5_2 1.open1_mean_cat_all#17.week_from_opening_7_5_2 1.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Hybrid) mlcolor(black) mcolor(gs12) ciopts(color(gs10)))   (traditional_NE_20, keep(2.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Traditional) mlcolor(black) mcolor(gs5) ciopts(color(gs5))), yline(0, lcolor(black) lpattern(dash)) ylabel(-1(0.5)1.5) yscale(range(-1(0.5)1.5)) vertical rename(2.open1_mean_cat_all#1.week_from_opening_7_5_2 = 1.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 = 1.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 = 1.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 = 1.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 = 1.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 = 1.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 = 1.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 = 1.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 = 1.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 = 1.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 = 1.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 = 1.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 = 1.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 = 1.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 = 1.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 = 1.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 = 1.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2 = 1.open1_mean_cat_all#18.week_from_opening_7_5_2) coeflabels(1.open1_mean_cat_all#1.week_from_opening_7_5_2 = "-4" 1.open1_mean_cat_all#2.week_from_opening_7_5_2 = "-3" 1.open1_mean_cat_all#3.week_from_opening_7_5_2 = "-2" 1.open1_mean_cat_all#4.week_from_opening_7_5_2 = "-1" 1.open1_mean_cat_all#5.week_from_opening_7_5_2 = "0" 1.open1_mean_cat_all#6.week_from_opening_7_5_2 = "1" 1.open1_mean_cat_all#7.week_from_opening_7_5_2 = "2" 1.open1_mean_cat_all#8.week_from_opening_7_5_2 = "3" 1.open1_mean_cat_all#9.week_from_opening_7_5_2 = "4" 1.open1_mean_cat_all#10.week_from_opening_7_5_2 = "5" 1.open1_mean_cat_all#11.week_from_opening_7_5_2  = "6" 1.open1_mean_cat_all#12.week_from_opening_7_5_2 = "7" 1.open1_mean_cat_all#13.week_from_opening_7_5_2 = "8" 1.open1_mean_cat_all#14.week_from_opening_7_5_2 = "9" 1.open1_mean_cat_all#15.week_from_opening_7_5_2 = "10" 1.open1_mean_cat_all#16.week_from_opening_7_5_2 = "11" 1.open1_mean_cat_all#17.week_from_opening_7_5_2 = "12" 1.open1_mean_cat_all#18.week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)


graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - NE - 20+ years - 210412.gph", replace
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - NE - 20+ years - 210412.jpg", as(jpg) name("Graph") quality(100) replace







**W region
*running it once and saving the estimates as hybrid
reg cases_per_pop_20_log i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if region == 1, vce(cluster fips)

estimates store hybrid_W_20

*running it again and saving the estimates as traditional
reg cases_per_pop_20_log i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if region == 1, vce(cluster fips)

estimates store traditional_W_20

**PLOTTING THE COEFFICIENTS*****
coefplot (hybrid_W_20, keep(1.open1_mean_cat_all#1.week_from_opening_7_5_2 1.open1_mean_cat_all#2.week_from_opening_7_5_2 1.open1_mean_cat_all#3.week_from_opening_7_5_2 1.open1_mean_cat_all#4.week_from_opening_7_5_2 1.open1_mean_cat_all#5.week_from_opening_7_5_2 1.open1_mean_cat_all#6.week_from_opening_7_5_2 1.open1_mean_cat_all#7.week_from_opening_7_5_2 1.open1_mean_cat_all#8.week_from_opening_7_5_2 1.open1_mean_cat_all#9.week_from_opening_7_5_2 1.open1_mean_cat_all#10.week_from_opening_7_5_2 1.open1_mean_cat_all#11.week_from_opening_7_5_2 1.open1_mean_cat_all#12.week_from_opening_7_5_2 1.open1_mean_cat_all#13.week_from_opening_7_5_2 1.open1_mean_cat_all#14.week_from_opening_7_5_2 1.open1_mean_cat_all#15.week_from_opening_7_5_2 1.open1_mean_cat_all#16.week_from_opening_7_5_2 1.open1_mean_cat_all#17.week_from_opening_7_5_2 1.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Hybrid) mlcolor(black) mcolor(gs12) ciopts(color(gs10)))   (traditional_W_20, keep(2.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Traditional) mlcolor(black) mcolor(gs5) ciopts(color(gs5))), yline(0, lcolor(black) lpattern(dash)) ylabel(-1(0.5)2.5) yscale(range(-1(0.5)2.5)) vertical rename(2.open1_mean_cat_all#1.week_from_opening_7_5_2 = 1.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 = 1.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 = 1.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 = 1.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 = 1.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 = 1.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 = 1.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 = 1.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 = 1.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 = 1.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 = 1.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 = 1.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 = 1.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 = 1.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 = 1.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 = 1.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 = 1.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2 = 1.open1_mean_cat_all#18.week_from_opening_7_5_2) coeflabels(1.open1_mean_cat_all#1.week_from_opening_7_5_2 = "-4" 1.open1_mean_cat_all#2.week_from_opening_7_5_2 = "-3" 1.open1_mean_cat_all#3.week_from_opening_7_5_2 = "-2" 1.open1_mean_cat_all#4.week_from_opening_7_5_2 = "-1" 1.open1_mean_cat_all#5.week_from_opening_7_5_2 = "0" 1.open1_mean_cat_all#6.week_from_opening_7_5_2 = "1" 1.open1_mean_cat_all#7.week_from_opening_7_5_2 = "2" 1.open1_mean_cat_all#8.week_from_opening_7_5_2 = "3" 1.open1_mean_cat_all#9.week_from_opening_7_5_2 = "4" 1.open1_mean_cat_all#10.week_from_opening_7_5_2 = "5" 1.open1_mean_cat_all#11.week_from_opening_7_5_2  = "6" 1.open1_mean_cat_all#12.week_from_opening_7_5_2 = "7" 1.open1_mean_cat_all#13.week_from_opening_7_5_2 = "8" 1.open1_mean_cat_all#14.week_from_opening_7_5_2 = "9" 1.open1_mean_cat_all#15.week_from_opening_7_5_2 = "10" 1.open1_mean_cat_all#16.week_from_opening_7_5_2 = "11" 1.open1_mean_cat_all#17.week_from_opening_7_5_2 = "12" 1.open1_mean_cat_all#18.week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)


graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - W - 20+ years - 210412.gph", replace
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - W - 20+ years - 210412.jpg", as(jpg) name("Graph") quality(100) replace







**MW region
*running it once and saving the estimates as hybrid
reg cases_per_pop_20_log i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if region == 2, vce(cluster fips)

estimates store hybrid_MW_20

*running it again and saving the estimates as traditional
reg cases_per_pop_20_log i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if region == 2, vce(cluster fips)

estimates store traditional_MW_20

**PLOTTING THE COEFFICIENTS*****
coefplot (hybrid_MW_20, keep(1.open1_mean_cat_all#1.week_from_opening_7_5_2 1.open1_mean_cat_all#2.week_from_opening_7_5_2 1.open1_mean_cat_all#3.week_from_opening_7_5_2 1.open1_mean_cat_all#4.week_from_opening_7_5_2 1.open1_mean_cat_all#5.week_from_opening_7_5_2 1.open1_mean_cat_all#6.week_from_opening_7_5_2 1.open1_mean_cat_all#7.week_from_opening_7_5_2 1.open1_mean_cat_all#8.week_from_opening_7_5_2 1.open1_mean_cat_all#9.week_from_opening_7_5_2 1.open1_mean_cat_all#10.week_from_opening_7_5_2 1.open1_mean_cat_all#11.week_from_opening_7_5_2 1.open1_mean_cat_all#12.week_from_opening_7_5_2 1.open1_mean_cat_all#13.week_from_opening_7_5_2 1.open1_mean_cat_all#14.week_from_opening_7_5_2 1.open1_mean_cat_all#15.week_from_opening_7_5_2 1.open1_mean_cat_all#16.week_from_opening_7_5_2 1.open1_mean_cat_all#17.week_from_opening_7_5_2 1.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Hybrid) mlcolor(black) mcolor(gs12) ciopts(color(gs10)))   (traditional_MW_20, keep(2.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Traditional) mlcolor(black) mcolor(gs5) ciopts(color(gs5))), yline(0, lcolor(black) lpattern(dash)) ylabel(-2(0.5)1) yscale(range(-2(0.5)1)) vertical rename(2.open1_mean_cat_all#1.week_from_opening_7_5_2 = 1.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 = 1.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 = 1.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 = 1.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 = 1.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 = 1.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 = 1.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 = 1.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 = 1.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 = 1.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 = 1.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 = 1.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 = 1.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 = 1.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 = 1.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 = 1.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 = 1.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2 = 1.open1_mean_cat_all#18.week_from_opening_7_5_2) coeflabels(1.open1_mean_cat_all#1.week_from_opening_7_5_2 = "-4" 1.open1_mean_cat_all#2.week_from_opening_7_5_2 = "-3" 1.open1_mean_cat_all#3.week_from_opening_7_5_2 = "-2" 1.open1_mean_cat_all#4.week_from_opening_7_5_2 = "-1" 1.open1_mean_cat_all#5.week_from_opening_7_5_2 = "0" 1.open1_mean_cat_all#6.week_from_opening_7_5_2 = "1" 1.open1_mean_cat_all#7.week_from_opening_7_5_2 = "2" 1.open1_mean_cat_all#8.week_from_opening_7_5_2 = "3" 1.open1_mean_cat_all#9.week_from_opening_7_5_2 = "4" 1.open1_mean_cat_all#10.week_from_opening_7_5_2 = "5" 1.open1_mean_cat_all#11.week_from_opening_7_5_2  = "6" 1.open1_mean_cat_all#12.week_from_opening_7_5_2 = "7" 1.open1_mean_cat_all#13.week_from_opening_7_5_2 = "8" 1.open1_mean_cat_all#14.week_from_opening_7_5_2 = "9" 1.open1_mean_cat_all#15.week_from_opening_7_5_2 = "10" 1.open1_mean_cat_all#16.week_from_opening_7_5_2 = "11" 1.open1_mean_cat_all#17.week_from_opening_7_5_2 = "12" 1.open1_mean_cat_all#18.week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)


graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - MW - 20+ years - 210412.gph", replace
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - MW - 20+ years - 210412.jpg", as(jpg) name("Graph") quality(100) replace






**S region
*running it once and saving the estimates as hybrid
reg cases_per_pop_20_log i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if region == 3, vce(cluster fips)

estimates store hybrid_S_20

*running it again and saving the estimates as traditional
reg cases_per_pop_20_log i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if region == 3, vce(cluster fips)

estimates store traditional_S_20

**PLOTTING THE COEFFICIENTS*****
coefplot (hybrid_S_20, keep(1.open1_mean_cat_all#1.week_from_opening_7_5_2 1.open1_mean_cat_all#2.week_from_opening_7_5_2 1.open1_mean_cat_all#3.week_from_opening_7_5_2 1.open1_mean_cat_all#4.week_from_opening_7_5_2 1.open1_mean_cat_all#5.week_from_opening_7_5_2 1.open1_mean_cat_all#6.week_from_opening_7_5_2 1.open1_mean_cat_all#7.week_from_opening_7_5_2 1.open1_mean_cat_all#8.week_from_opening_7_5_2 1.open1_mean_cat_all#9.week_from_opening_7_5_2 1.open1_mean_cat_all#10.week_from_opening_7_5_2 1.open1_mean_cat_all#11.week_from_opening_7_5_2 1.open1_mean_cat_all#12.week_from_opening_7_5_2 1.open1_mean_cat_all#13.week_from_opening_7_5_2 1.open1_mean_cat_all#14.week_from_opening_7_5_2 1.open1_mean_cat_all#15.week_from_opening_7_5_2 1.open1_mean_cat_all#16.week_from_opening_7_5_2 1.open1_mean_cat_all#17.week_from_opening_7_5_2 1.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Hybrid) mlcolor(black) mcolor(gs12) ciopts(color(gs10)))   (traditional_S_20, keep(2.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Traditional) mlcolor(black) mcolor(gs5) ciopts(color(gs5))), yline(0, lcolor(black) lpattern(dash)) ylabel(-1(0.5)1) yscale(range(-1(0.5)1)) vertical rename(2.open1_mean_cat_all#1.week_from_opening_7_5_2 = 1.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 = 1.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 = 1.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 = 1.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 = 1.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 = 1.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 = 1.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 = 1.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 = 1.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 = 1.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 = 1.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 = 1.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 = 1.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 = 1.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 = 1.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 = 1.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 = 1.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2 = 1.open1_mean_cat_all#18.week_from_opening_7_5_2) coeflabels(1.open1_mean_cat_all#1.week_from_opening_7_5_2 = "-4" 1.open1_mean_cat_all#2.week_from_opening_7_5_2 = "-3" 1.open1_mean_cat_all#3.week_from_opening_7_5_2 = "-2" 1.open1_mean_cat_all#4.week_from_opening_7_5_2 = "-1" 1.open1_mean_cat_all#5.week_from_opening_7_5_2 = "0" 1.open1_mean_cat_all#6.week_from_opening_7_5_2 = "1" 1.open1_mean_cat_all#7.week_from_opening_7_5_2 = "2" 1.open1_mean_cat_all#8.week_from_opening_7_5_2 = "3" 1.open1_mean_cat_all#9.week_from_opening_7_5_2 = "4" 1.open1_mean_cat_all#10.week_from_opening_7_5_2 = "5" 1.open1_mean_cat_all#11.week_from_opening_7_5_2  = "6" 1.open1_mean_cat_all#12.week_from_opening_7_5_2 = "7" 1.open1_mean_cat_all#13.week_from_opening_7_5_2 = "8" 1.open1_mean_cat_all#14.week_from_opening_7_5_2 = "9" 1.open1_mean_cat_all#15.week_from_opening_7_5_2 = "10" 1.open1_mean_cat_all#16.week_from_opening_7_5_2 = "11" 1.open1_mean_cat_all#17.week_from_opening_7_5_2 = "12" 1.open1_mean_cat_all#18.week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)


graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - S - 20+ years - 210412.gph", replace
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - S - 20+ years - 210412.jpg", as(jpg) name("Graph") quality(100) replace














***CHANGE FROM BASELINE (OLS)

log using "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\COVID School Analyses - Change from Baseline - 210329.smcl", replace

**overall
*running it once and saving the estimates as hybrid
reg cases_per_pop_bl_diff i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips, vce(cluster fips)

estimates store change_bl_hybrid_overall

*running it again and saving the estimates as traditional
reg cases_per_pop_bl_diff i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips, vce(cluster fips)

estimates store change_bl_trad_overall

**PLOTTING THE COEFFICIENTS*****
coefplot (change_bl_hybrid_overall, keep(1.open1_mean_cat_all#1.week_from_opening_7_5_2 1.open1_mean_cat_all#2.week_from_opening_7_5_2 1.open1_mean_cat_all#3.week_from_opening_7_5_2 1.open1_mean_cat_all#4.week_from_opening_7_5_2 1.open1_mean_cat_all#5.week_from_opening_7_5_2 1.open1_mean_cat_all#6.week_from_opening_7_5_2 1.open1_mean_cat_all#7.week_from_opening_7_5_2 1.open1_mean_cat_all#8.week_from_opening_7_5_2 1.open1_mean_cat_all#9.week_from_opening_7_5_2 1.open1_mean_cat_all#10.week_from_opening_7_5_2 1.open1_mean_cat_all#11.week_from_opening_7_5_2 1.open1_mean_cat_all#12.week_from_opening_7_5_2 1.open1_mean_cat_all#13.week_from_opening_7_5_2 1.open1_mean_cat_all#14.week_from_opening_7_5_2 1.open1_mean_cat_all#15.week_from_opening_7_5_2 1.open1_mean_cat_all#16.week_from_opening_7_5_2 1.open1_mean_cat_all#17.week_from_opening_7_5_2 1.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Hybrid) mlcolor(black))   (change_bl_trad_overall, keep(2.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Traditional) mlcolor(black)), yline(0, lcolor(black) lpattern(dash)) vertical rename(2.open1_mean_cat_all#1.week_from_opening_7_5_2 = 1.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 = 1.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 = 1.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 = 1.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 = 1.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 = 1.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 = 1.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 = 1.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 = 1.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 = 1.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 = 1.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 = 1.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 = 1.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 = 1.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 = 1.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 = 1.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 = 1.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2 = 1.open1_mean_cat_all#18.week_from_opening_7_5_2) coeflabels(1.open1_mean_cat_all#1.week_from_opening_7_5_2 = "-4" 1.open1_mean_cat_all#2.week_from_opening_7_5_2 = "-3" 1.open1_mean_cat_all#3.week_from_opening_7_5_2 = "-2" 1.open1_mean_cat_all#4.week_from_opening_7_5_2 = "-1" 1.open1_mean_cat_all#5.week_from_opening_7_5_2 = "0" 1.open1_mean_cat_all#6.week_from_opening_7_5_2 = "1" 1.open1_mean_cat_all#7.week_from_opening_7_5_2 = "2" 1.open1_mean_cat_all#8.week_from_opening_7_5_2 = "3" 1.open1_mean_cat_all#9.week_from_opening_7_5_2 = "4" 1.open1_mean_cat_all#10.week_from_opening_7_5_2 = "5" 1.open1_mean_cat_all#11.week_from_opening_7_5_2  = "6" 1.open1_mean_cat_all#12.week_from_opening_7_5_2 = "7" 1.open1_mean_cat_all#13.week_from_opening_7_5_2 = "8" 1.open1_mean_cat_all#14.week_from_opening_7_5_2 = "9" 1.open1_mean_cat_all#15.week_from_opening_7_5_2 = "10" 1.open1_mean_cat_all#16.week_from_opening_7_5_2 = "11" 1.open1_mean_cat_all#17.week_from_opening_7_5_2 = "12" 1.open1_mean_cat_all#18.week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)


graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Overall Change from Baseline - 210329.gph", replace
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Overall Change from Baseline - 210329.jpg", as(jpg) name("Graph") quality(100) replace






**NE region
*running it once and saving the estimates as hybrid
reg cases_per_pop_bl_diff i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if region == 0, vce(cluster fips)

estimates store change_bl_hybrid_NE

*running it again and saving the estimates as traditional
reg cases_per_pop_bl_diff i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if region == 0, vce(cluster fips)

estimates store change_bl_traditional_NE

**PLOTTING THE COEFFICIENTS*****
coefplot (change_bl_hybrid_NE, keep(1.open1_mean_cat_all#1.week_from_opening_7_5_2 1.open1_mean_cat_all#2.week_from_opening_7_5_2 1.open1_mean_cat_all#3.week_from_opening_7_5_2 1.open1_mean_cat_all#4.week_from_opening_7_5_2 1.open1_mean_cat_all#5.week_from_opening_7_5_2 1.open1_mean_cat_all#6.week_from_opening_7_5_2 1.open1_mean_cat_all#7.week_from_opening_7_5_2 1.open1_mean_cat_all#8.week_from_opening_7_5_2 1.open1_mean_cat_all#9.week_from_opening_7_5_2 1.open1_mean_cat_all#10.week_from_opening_7_5_2 1.open1_mean_cat_all#11.week_from_opening_7_5_2 1.open1_mean_cat_all#12.week_from_opening_7_5_2 1.open1_mean_cat_all#13.week_from_opening_7_5_2 1.open1_mean_cat_all#14.week_from_opening_7_5_2 1.open1_mean_cat_all#15.week_from_opening_7_5_2 1.open1_mean_cat_all#16.week_from_opening_7_5_2 1.open1_mean_cat_all#17.week_from_opening_7_5_2 1.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Hybrid) mlcolor(black))   (change_bl_traditional_NE, keep(2.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Traditional) mlcolor(black)), yline(0, lcolor(black) lpattern(dash)) vertical rename(2.open1_mean_cat_all#1.week_from_opening_7_5_2 = 1.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 = 1.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 = 1.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 = 1.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 = 1.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 = 1.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 = 1.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 = 1.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 = 1.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 = 1.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 = 1.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 = 1.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 = 1.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 = 1.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 = 1.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 = 1.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 = 1.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2 = 1.open1_mean_cat_all#18.week_from_opening_7_5_2) coeflabels(1.open1_mean_cat_all#1.week_from_opening_7_5_2 = "-4" 1.open1_mean_cat_all#2.week_from_opening_7_5_2 = "-3" 1.open1_mean_cat_all#3.week_from_opening_7_5_2 = "-2" 1.open1_mean_cat_all#4.week_from_opening_7_5_2 = "-1" 1.open1_mean_cat_all#5.week_from_opening_7_5_2 = "0" 1.open1_mean_cat_all#6.week_from_opening_7_5_2 = "1" 1.open1_mean_cat_all#7.week_from_opening_7_5_2 = "2" 1.open1_mean_cat_all#8.week_from_opening_7_5_2 = "3" 1.open1_mean_cat_all#9.week_from_opening_7_5_2 = "4" 1.open1_mean_cat_all#10.week_from_opening_7_5_2 = "5" 1.open1_mean_cat_all#11.week_from_opening_7_5_2  = "6" 1.open1_mean_cat_all#12.week_from_opening_7_5_2 = "7" 1.open1_mean_cat_all#13.week_from_opening_7_5_2 = "8" 1.open1_mean_cat_all#14.week_from_opening_7_5_2 = "9" 1.open1_mean_cat_all#15.week_from_opening_7_5_2 = "10" 1.open1_mean_cat_all#16.week_from_opening_7_5_2 = "11" 1.open1_mean_cat_all#17.week_from_opening_7_5_2 = "12" 1.open1_mean_cat_all#18.week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)


graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - NE Change from Baseline - 210329.gph"
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - NE Change from Baseline - 210329.jpg", as(jpg) name("Graph") quality(100)







**W region
*running it once and saving the estimates as hybrid
reg cases_per_pop_bl_diff i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if region == 1, vce(cluster fips)

estimates store change_bl_hybrid_W

*running it again and saving the estimates as traditional
reg cases_per_pop_bl_diff i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if region == 1, vce(cluster fips)

estimates store change_bl_traditional_W

**PLOTTING THE COEFFICIENTS*****
coefplot (change_bl_hybrid_W, keep(1.open1_mean_cat_all#1.week_from_opening_7_5_2 1.open1_mean_cat_all#2.week_from_opening_7_5_2 1.open1_mean_cat_all#3.week_from_opening_7_5_2 1.open1_mean_cat_all#4.week_from_opening_7_5_2 1.open1_mean_cat_all#5.week_from_opening_7_5_2 1.open1_mean_cat_all#6.week_from_opening_7_5_2 1.open1_mean_cat_all#7.week_from_opening_7_5_2 1.open1_mean_cat_all#8.week_from_opening_7_5_2 1.open1_mean_cat_all#9.week_from_opening_7_5_2 1.open1_mean_cat_all#10.week_from_opening_7_5_2 1.open1_mean_cat_all#11.week_from_opening_7_5_2 1.open1_mean_cat_all#12.week_from_opening_7_5_2 1.open1_mean_cat_all#13.week_from_opening_7_5_2 1.open1_mean_cat_all#14.week_from_opening_7_5_2 1.open1_mean_cat_all#15.week_from_opening_7_5_2 1.open1_mean_cat_all#16.week_from_opening_7_5_2 1.open1_mean_cat_all#17.week_from_opening_7_5_2 1.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Hybrid) mlcolor(black))   (change_bl_traditional_W, keep(2.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Traditional) mlcolor(black)), yline(0, lcolor(black) lpattern(dash)) vertical rename(2.open1_mean_cat_all#1.week_from_opening_7_5_2 = 1.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 = 1.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 = 1.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 = 1.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 = 1.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 = 1.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 = 1.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 = 1.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 = 1.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 = 1.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 = 1.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 = 1.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 = 1.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 = 1.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 = 1.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 = 1.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 = 1.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2 = 1.open1_mean_cat_all#18.week_from_opening_7_5_2) coeflabels(1.open1_mean_cat_all#1.week_from_opening_7_5_2 = "-4" 1.open1_mean_cat_all#2.week_from_opening_7_5_2 = "-3" 1.open1_mean_cat_all#3.week_from_opening_7_5_2 = "-2" 1.open1_mean_cat_all#4.week_from_opening_7_5_2 = "-1" 1.open1_mean_cat_all#5.week_from_opening_7_5_2 = "0" 1.open1_mean_cat_all#6.week_from_opening_7_5_2 = "1" 1.open1_mean_cat_all#7.week_from_opening_7_5_2 = "2" 1.open1_mean_cat_all#8.week_from_opening_7_5_2 = "3" 1.open1_mean_cat_all#9.week_from_opening_7_5_2 = "4" 1.open1_mean_cat_all#10.week_from_opening_7_5_2 = "5" 1.open1_mean_cat_all#11.week_from_opening_7_5_2  = "6" 1.open1_mean_cat_all#12.week_from_opening_7_5_2 = "7" 1.open1_mean_cat_all#13.week_from_opening_7_5_2 = "8" 1.open1_mean_cat_all#14.week_from_opening_7_5_2 = "9" 1.open1_mean_cat_all#15.week_from_opening_7_5_2 = "10" 1.open1_mean_cat_all#16.week_from_opening_7_5_2 = "11" 1.open1_mean_cat_all#17.week_from_opening_7_5_2 = "12" 1.open1_mean_cat_all#18.week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)


graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - W Change from Baseline - 210329.gph"
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - W Change from Baseline - 210329.jpg", as(jpg) name("Graph") quality(100)







**MW region
*running it once and saving the estimates as hybrid
reg cases_per_pop_bl_diff i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if region == 2, vce(cluster fips)

estimates store change_bl_hybrid_MW

*running it again and saving the estimates as traditional
reg cases_per_pop_bl_diff i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if region == 2, vce(cluster fips)

estimates store change_bl_traditional_MW

**PLOTTING THE COEFFICIENTS*****
coefplot (change_bl_hybrid_MW, keep(1.open1_mean_cat_all#1.week_from_opening_7_5_2 1.open1_mean_cat_all#2.week_from_opening_7_5_2 1.open1_mean_cat_all#3.week_from_opening_7_5_2 1.open1_mean_cat_all#4.week_from_opening_7_5_2 1.open1_mean_cat_all#5.week_from_opening_7_5_2 1.open1_mean_cat_all#6.week_from_opening_7_5_2 1.open1_mean_cat_all#7.week_from_opening_7_5_2 1.open1_mean_cat_all#8.week_from_opening_7_5_2 1.open1_mean_cat_all#9.week_from_opening_7_5_2 1.open1_mean_cat_all#10.week_from_opening_7_5_2 1.open1_mean_cat_all#11.week_from_opening_7_5_2 1.open1_mean_cat_all#12.week_from_opening_7_5_2 1.open1_mean_cat_all#13.week_from_opening_7_5_2 1.open1_mean_cat_all#14.week_from_opening_7_5_2 1.open1_mean_cat_all#15.week_from_opening_7_5_2 1.open1_mean_cat_all#16.week_from_opening_7_5_2 1.open1_mean_cat_all#17.week_from_opening_7_5_2 1.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Hybrid) mlcolor(black))   (change_bl_traditional_MW, keep(2.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Traditional) mlcolor(black)), yline(0, lcolor(black) lpattern(dash)) vertical rename(2.open1_mean_cat_all#1.week_from_opening_7_5_2 = 1.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 = 1.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 = 1.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 = 1.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 = 1.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 = 1.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 = 1.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 = 1.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 = 1.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 = 1.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 = 1.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 = 1.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 = 1.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 = 1.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 = 1.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 = 1.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 = 1.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2 = 1.open1_mean_cat_all#18.week_from_opening_7_5_2) coeflabels(1.open1_mean_cat_all#1.week_from_opening_7_5_2 = "-4" 1.open1_mean_cat_all#2.week_from_opening_7_5_2 = "-3" 1.open1_mean_cat_all#3.week_from_opening_7_5_2 = "-2" 1.open1_mean_cat_all#4.week_from_opening_7_5_2 = "-1" 1.open1_mean_cat_all#5.week_from_opening_7_5_2 = "0" 1.open1_mean_cat_all#6.week_from_opening_7_5_2 = "1" 1.open1_mean_cat_all#7.week_from_opening_7_5_2 = "2" 1.open1_mean_cat_all#8.week_from_opening_7_5_2 = "3" 1.open1_mean_cat_all#9.week_from_opening_7_5_2 = "4" 1.open1_mean_cat_all#10.week_from_opening_7_5_2 = "5" 1.open1_mean_cat_all#11.week_from_opening_7_5_2  = "6" 1.open1_mean_cat_all#12.week_from_opening_7_5_2 = "7" 1.open1_mean_cat_all#13.week_from_opening_7_5_2 = "8" 1.open1_mean_cat_all#14.week_from_opening_7_5_2 = "9" 1.open1_mean_cat_all#15.week_from_opening_7_5_2 = "10" 1.open1_mean_cat_all#16.week_from_opening_7_5_2 = "11" 1.open1_mean_cat_all#17.week_from_opening_7_5_2 = "12" 1.open1_mean_cat_all#18.week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)


graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - MW Change from Baseline - 210329.gph"
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - MW Change from Baseline - 210329.jpg", as(jpg) name("Graph") quality(100)






**S region
*running it once and saving the estimates as hybrid
reg cases_per_pop_bl_diff i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if region == 3, vce(cluster fips)

estimates store change_bl_hybrid_S

*running it again and saving the estimates as traditional
reg cases_per_pop_bl_diff i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if region == 3, vce(cluster fips)

estimates store change_bl_traditional_S

**PLOTTING THE COEFFICIENTS*****
coefplot (change_bl_hybrid_S, keep(1.open1_mean_cat_all#1.week_from_opening_7_5_2 1.open1_mean_cat_all#2.week_from_opening_7_5_2 1.open1_mean_cat_all#3.week_from_opening_7_5_2 1.open1_mean_cat_all#4.week_from_opening_7_5_2 1.open1_mean_cat_all#5.week_from_opening_7_5_2 1.open1_mean_cat_all#6.week_from_opening_7_5_2 1.open1_mean_cat_all#7.week_from_opening_7_5_2 1.open1_mean_cat_all#8.week_from_opening_7_5_2 1.open1_mean_cat_all#9.week_from_opening_7_5_2 1.open1_mean_cat_all#10.week_from_opening_7_5_2 1.open1_mean_cat_all#11.week_from_opening_7_5_2 1.open1_mean_cat_all#12.week_from_opening_7_5_2 1.open1_mean_cat_all#13.week_from_opening_7_5_2 1.open1_mean_cat_all#14.week_from_opening_7_5_2 1.open1_mean_cat_all#15.week_from_opening_7_5_2 1.open1_mean_cat_all#16.week_from_opening_7_5_2 1.open1_mean_cat_all#17.week_from_opening_7_5_2 1.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Hybrid) mlcolor(black))   (change_bl_traditional_S, keep(2.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Traditional) mlcolor(black)), yline(0, lcolor(black) lpattern(dash)) vertical rename(2.open1_mean_cat_all#1.week_from_opening_7_5_2 = 1.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 = 1.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 = 1.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 = 1.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 = 1.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 = 1.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 = 1.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 = 1.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 = 1.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 = 1.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 = 1.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 = 1.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 = 1.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 = 1.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 = 1.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 = 1.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 = 1.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2 = 1.open1_mean_cat_all#18.week_from_opening_7_5_2) coeflabels(1.open1_mean_cat_all#1.week_from_opening_7_5_2 = "-4" 1.open1_mean_cat_all#2.week_from_opening_7_5_2 = "-3" 1.open1_mean_cat_all#3.week_from_opening_7_5_2 = "-2" 1.open1_mean_cat_all#4.week_from_opening_7_5_2 = "-1" 1.open1_mean_cat_all#5.week_from_opening_7_5_2 = "0" 1.open1_mean_cat_all#6.week_from_opening_7_5_2 = "1" 1.open1_mean_cat_all#7.week_from_opening_7_5_2 = "2" 1.open1_mean_cat_all#8.week_from_opening_7_5_2 = "3" 1.open1_mean_cat_all#9.week_from_opening_7_5_2 = "4" 1.open1_mean_cat_all#10.week_from_opening_7_5_2 = "5" 1.open1_mean_cat_all#11.week_from_opening_7_5_2  = "6" 1.open1_mean_cat_all#12.week_from_opening_7_5_2 = "7" 1.open1_mean_cat_all#13.week_from_opening_7_5_2 = "8" 1.open1_mean_cat_all#14.week_from_opening_7_5_2 = "9" 1.open1_mean_cat_all#15.week_from_opening_7_5_2 = "10" 1.open1_mean_cat_all#16.week_from_opening_7_5_2 = "11" 1.open1_mean_cat_all#17.week_from_opening_7_5_2 = "12" 1.open1_mean_cat_all#18.week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)


graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - S Change from Baseline - 210329.gph"
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - S Change from Baseline - 210329.jpg", as(jpg) name("Graph") quality(100)




******************
**Age 0-9 years***
******************


**overall
*running it once and saving the estimates as hybrid
reg cases_per_pop_bl_0_9_diff i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips, vce(cluster fips)

estimates store change_bl_hybr_overall_0_9

*running it again and saving the estimates as traditional
reg cases_per_pop_bl_0_9_diff i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips, vce(cluster fips)

estimates store change_bl_trad_overall_0_9

**PLOTTING THE COEFFICIENTS*****
coefplot (change_bl_hybr_overall_0_9, keep(1.open1_mean_cat_all#1.week_from_opening_7_5_2 1.open1_mean_cat_all#2.week_from_opening_7_5_2 1.open1_mean_cat_all#3.week_from_opening_7_5_2 1.open1_mean_cat_all#4.week_from_opening_7_5_2 1.open1_mean_cat_all#5.week_from_opening_7_5_2 1.open1_mean_cat_all#6.week_from_opening_7_5_2 1.open1_mean_cat_all#7.week_from_opening_7_5_2 1.open1_mean_cat_all#8.week_from_opening_7_5_2 1.open1_mean_cat_all#9.week_from_opening_7_5_2 1.open1_mean_cat_all#10.week_from_opening_7_5_2 1.open1_mean_cat_all#11.week_from_opening_7_5_2 1.open1_mean_cat_all#12.week_from_opening_7_5_2 1.open1_mean_cat_all#13.week_from_opening_7_5_2 1.open1_mean_cat_all#14.week_from_opening_7_5_2 1.open1_mean_cat_all#15.week_from_opening_7_5_2 1.open1_mean_cat_all#16.week_from_opening_7_5_2 1.open1_mean_cat_all#17.week_from_opening_7_5_2 1.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Hybrid) mlcolor(black) mcolor(gs12) ciopts(color(gs10)))   (change_bl_trad_overall_0_9, keep(2.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Traditional) mlcolor(black) mcolor(gs5) ciopts(color(gs5))), yline(0, lcolor(black) lpattern(dash)) ylabel(-0.005(0.005)0.01) yscale(range(-0.005(0.005)0.01)) vertical rename(2.open1_mean_cat_all#1.week_from_opening_7_5_2 = 1.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 = 1.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 = 1.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 = 1.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 = 1.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 = 1.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 = 1.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 = 1.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 = 1.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 = 1.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 = 1.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 = 1.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 = 1.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 = 1.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 = 1.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 = 1.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 = 1.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2 = 1.open1_mean_cat_all#18.week_from_opening_7_5_2) coeflabels(1.open1_mean_cat_all#1.week_from_opening_7_5_2 = "-4" 1.open1_mean_cat_all#2.week_from_opening_7_5_2 = "-3" 1.open1_mean_cat_all#3.week_from_opening_7_5_2 = "-2" 1.open1_mean_cat_all#4.week_from_opening_7_5_2 = "-1" 1.open1_mean_cat_all#5.week_from_opening_7_5_2 = "0" 1.open1_mean_cat_all#6.week_from_opening_7_5_2 = "1" 1.open1_mean_cat_all#7.week_from_opening_7_5_2 = "2" 1.open1_mean_cat_all#8.week_from_opening_7_5_2 = "3" 1.open1_mean_cat_all#9.week_from_opening_7_5_2 = "4" 1.open1_mean_cat_all#10.week_from_opening_7_5_2 = "5" 1.open1_mean_cat_all#11.week_from_opening_7_5_2  = "6" 1.open1_mean_cat_all#12.week_from_opening_7_5_2 = "7" 1.open1_mean_cat_all#13.week_from_opening_7_5_2 = "8" 1.open1_mean_cat_all#14.week_from_opening_7_5_2 = "9" 1.open1_mean_cat_all#15.week_from_opening_7_5_2 = "10" 1.open1_mean_cat_all#16.week_from_opening_7_5_2 = "11" 1.open1_mean_cat_all#17.week_from_opening_7_5_2 = "12" 1.open1_mean_cat_all#18.week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)


graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Overall Change from Baseline - 0-9 years - 210412.gph", replace
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Overall Change from Baseline - 0-9 years - 210412.jpg", as(jpg) name("Graph") quality(100) replace






**NE region
*running it once and saving the estimates as hybrid
reg cases_per_pop_bl_0_9_diff i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if region == 0, vce(cluster fips)

estimates store change_bl_hybrid_NE_0_9

*running it again and saving the estimates as traditional
reg cases_per_pop_bl_0_9_diff i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if region == 0, vce(cluster fips)

estimates store change_bl_trad_NE_0_9

**PLOTTING THE COEFFICIENTS*****
coefplot (change_bl_hybrid_NE_0_9, keep(1.open1_mean_cat_all#1.week_from_opening_7_5_2 1.open1_mean_cat_all#2.week_from_opening_7_5_2 1.open1_mean_cat_all#3.week_from_opening_7_5_2 1.open1_mean_cat_all#4.week_from_opening_7_5_2 1.open1_mean_cat_all#5.week_from_opening_7_5_2 1.open1_mean_cat_all#6.week_from_opening_7_5_2 1.open1_mean_cat_all#7.week_from_opening_7_5_2 1.open1_mean_cat_all#8.week_from_opening_7_5_2 1.open1_mean_cat_all#9.week_from_opening_7_5_2 1.open1_mean_cat_all#10.week_from_opening_7_5_2 1.open1_mean_cat_all#11.week_from_opening_7_5_2 1.open1_mean_cat_all#12.week_from_opening_7_5_2 1.open1_mean_cat_all#13.week_from_opening_7_5_2 1.open1_mean_cat_all#14.week_from_opening_7_5_2 1.open1_mean_cat_all#15.week_from_opening_7_5_2 1.open1_mean_cat_all#16.week_from_opening_7_5_2 1.open1_mean_cat_all#17.week_from_opening_7_5_2 1.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Hybrid) mlcolor(black) mcolor(gs12) ciopts(color(gs10)))   (change_bl_trad_NE_0_9, keep(2.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Traditional) mlcolor(black) mcolor(gs5) ciopts(color(gs5))), yline(0, lcolor(black) lpattern(dash)) ylabel(-0.005(0.005)0.01) yscale(range(-0.005(0.005)0.01)) vertical rename(2.open1_mean_cat_all#1.week_from_opening_7_5_2 = 1.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 = 1.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 = 1.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 = 1.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 = 1.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 = 1.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 = 1.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 = 1.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 = 1.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 = 1.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 = 1.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 = 1.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 = 1.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 = 1.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 = 1.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 = 1.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 = 1.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2 = 1.open1_mean_cat_all#18.week_from_opening_7_5_2) coeflabels(1.open1_mean_cat_all#1.week_from_opening_7_5_2 = "-4" 1.open1_mean_cat_all#2.week_from_opening_7_5_2 = "-3" 1.open1_mean_cat_all#3.week_from_opening_7_5_2 = "-2" 1.open1_mean_cat_all#4.week_from_opening_7_5_2 = "-1" 1.open1_mean_cat_all#5.week_from_opening_7_5_2 = "0" 1.open1_mean_cat_all#6.week_from_opening_7_5_2 = "1" 1.open1_mean_cat_all#7.week_from_opening_7_5_2 = "2" 1.open1_mean_cat_all#8.week_from_opening_7_5_2 = "3" 1.open1_mean_cat_all#9.week_from_opening_7_5_2 = "4" 1.open1_mean_cat_all#10.week_from_opening_7_5_2 = "5" 1.open1_mean_cat_all#11.week_from_opening_7_5_2  = "6" 1.open1_mean_cat_all#12.week_from_opening_7_5_2 = "7" 1.open1_mean_cat_all#13.week_from_opening_7_5_2 = "8" 1.open1_mean_cat_all#14.week_from_opening_7_5_2 = "9" 1.open1_mean_cat_all#15.week_from_opening_7_5_2 = "10" 1.open1_mean_cat_all#16.week_from_opening_7_5_2 = "11" 1.open1_mean_cat_all#17.week_from_opening_7_5_2 = "12" 1.open1_mean_cat_all#18.week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)


graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - NE Change from Baseline - 0-9 years - 210412.gph"
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - NE Change from Baseline - 0-9 years - 210412.jpg", as(jpg) name("Graph") quality(100)







**W region
*running it once and saving the estimates as hybrid
reg cases_per_pop_bl_0_9_diff i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if region == 1, vce(cluster fips)

estimates store change_bl_hybrid_W_0_9

*running it again and saving the estimates as traditional
reg cases_per_pop_bl_0_9_diff i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if region == 1, vce(cluster fips)

estimates store change_bl_trad_W_0_9

**PLOTTING THE COEFFICIENTS*****
coefplot (change_bl_hybrid_W_0_9, keep(1.open1_mean_cat_all#1.week_from_opening_7_5_2 1.open1_mean_cat_all#2.week_from_opening_7_5_2 1.open1_mean_cat_all#3.week_from_opening_7_5_2 1.open1_mean_cat_all#4.week_from_opening_7_5_2 1.open1_mean_cat_all#5.week_from_opening_7_5_2 1.open1_mean_cat_all#6.week_from_opening_7_5_2 1.open1_mean_cat_all#7.week_from_opening_7_5_2 1.open1_mean_cat_all#8.week_from_opening_7_5_2 1.open1_mean_cat_all#9.week_from_opening_7_5_2 1.open1_mean_cat_all#10.week_from_opening_7_5_2 1.open1_mean_cat_all#11.week_from_opening_7_5_2 1.open1_mean_cat_all#12.week_from_opening_7_5_2 1.open1_mean_cat_all#13.week_from_opening_7_5_2 1.open1_mean_cat_all#14.week_from_opening_7_5_2 1.open1_mean_cat_all#15.week_from_opening_7_5_2 1.open1_mean_cat_all#16.week_from_opening_7_5_2 1.open1_mean_cat_all#17.week_from_opening_7_5_2 1.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Hybrid) mlcolor(black) mcolor(gs12) ciopts(color(gs10)))   (change_bl_trad_W_0_9, keep(2.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Traditional) mlcolor(black) mcolor(gs5) ciopts(color(gs5))), yline(0, lcolor(black) lpattern(dash)) ylabel(-0.005(0.005)0.025) yscale(range(-0.005(0.005)0.025)) vertical rename(2.open1_mean_cat_all#1.week_from_opening_7_5_2 = 1.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 = 1.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 = 1.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 = 1.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 = 1.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 = 1.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 = 1.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 = 1.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 = 1.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 = 1.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 = 1.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 = 1.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 = 1.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 = 1.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 = 1.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 = 1.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 = 1.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2 = 1.open1_mean_cat_all#18.week_from_opening_7_5_2) coeflabels(1.open1_mean_cat_all#1.week_from_opening_7_5_2 = "-4" 1.open1_mean_cat_all#2.week_from_opening_7_5_2 = "-3" 1.open1_mean_cat_all#3.week_from_opening_7_5_2 = "-2" 1.open1_mean_cat_all#4.week_from_opening_7_5_2 = "-1" 1.open1_mean_cat_all#5.week_from_opening_7_5_2 = "0" 1.open1_mean_cat_all#6.week_from_opening_7_5_2 = "1" 1.open1_mean_cat_all#7.week_from_opening_7_5_2 = "2" 1.open1_mean_cat_all#8.week_from_opening_7_5_2 = "3" 1.open1_mean_cat_all#9.week_from_opening_7_5_2 = "4" 1.open1_mean_cat_all#10.week_from_opening_7_5_2 = "5" 1.open1_mean_cat_all#11.week_from_opening_7_5_2  = "6" 1.open1_mean_cat_all#12.week_from_opening_7_5_2 = "7" 1.open1_mean_cat_all#13.week_from_opening_7_5_2 = "8" 1.open1_mean_cat_all#14.week_from_opening_7_5_2 = "9" 1.open1_mean_cat_all#15.week_from_opening_7_5_2 = "10" 1.open1_mean_cat_all#16.week_from_opening_7_5_2 = "11" 1.open1_mean_cat_all#17.week_from_opening_7_5_2 = "12" 1.open1_mean_cat_all#18.week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)

graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - W Change from Baseline - 0-9 years - 210412.gph"
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - W Change from Baseline - 0-9 years - 210412.jpg", as(jpg) name("Graph") quality(100)







**MW region
*running it once and saving the estimates as hybrid
reg cases_per_pop_bl_0_9_diff i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if region == 2, vce(cluster fips)

estimates store change_bl_hybrid_MW_0_9

*running it again and saving the estimates as traditional
reg cases_per_pop_bl_0_9_diff i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if region == 2, vce(cluster fips)

estimates store change_bl_trad_MW_0_9

**PLOTTING THE COEFFICIENTS*****
coefplot (change_bl_hybrid_MW_0_9, keep(1.open1_mean_cat_all#1.week_from_opening_7_5_2 1.open1_mean_cat_all#2.week_from_opening_7_5_2 1.open1_mean_cat_all#3.week_from_opening_7_5_2 1.open1_mean_cat_all#4.week_from_opening_7_5_2 1.open1_mean_cat_all#5.week_from_opening_7_5_2 1.open1_mean_cat_all#6.week_from_opening_7_5_2 1.open1_mean_cat_all#7.week_from_opening_7_5_2 1.open1_mean_cat_all#8.week_from_opening_7_5_2 1.open1_mean_cat_all#9.week_from_opening_7_5_2 1.open1_mean_cat_all#10.week_from_opening_7_5_2 1.open1_mean_cat_all#11.week_from_opening_7_5_2 1.open1_mean_cat_all#12.week_from_opening_7_5_2 1.open1_mean_cat_all#13.week_from_opening_7_5_2 1.open1_mean_cat_all#14.week_from_opening_7_5_2 1.open1_mean_cat_all#15.week_from_opening_7_5_2 1.open1_mean_cat_all#16.week_from_opening_7_5_2 1.open1_mean_cat_all#17.week_from_opening_7_5_2 1.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Hybrid) mlcolor(black) mcolor(gs12) ciopts(color(gs10)))   (change_bl_trad_MW_0_9, keep(2.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Traditional) mlcolor(black) mcolor(gs5) ciopts(color(gs5))), yline(0, lcolor(black) lpattern(dash)) ylabel(-0.025(0.005)0.015) yscale(range(-0.025(0.005)0.015)) vertical rename(2.open1_mean_cat_all#1.week_from_opening_7_5_2 = 1.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 = 1.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 = 1.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 = 1.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 = 1.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 = 1.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 = 1.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 = 1.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 = 1.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 = 1.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 = 1.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 = 1.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 = 1.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 = 1.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 = 1.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 = 1.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 = 1.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2 = 1.open1_mean_cat_all#18.week_from_opening_7_5_2) coeflabels(1.open1_mean_cat_all#1.week_from_opening_7_5_2 = "-4" 1.open1_mean_cat_all#2.week_from_opening_7_5_2 = "-3" 1.open1_mean_cat_all#3.week_from_opening_7_5_2 = "-2" 1.open1_mean_cat_all#4.week_from_opening_7_5_2 = "-1" 1.open1_mean_cat_all#5.week_from_opening_7_5_2 = "0" 1.open1_mean_cat_all#6.week_from_opening_7_5_2 = "1" 1.open1_mean_cat_all#7.week_from_opening_7_5_2 = "2" 1.open1_mean_cat_all#8.week_from_opening_7_5_2 = "3" 1.open1_mean_cat_all#9.week_from_opening_7_5_2 = "4" 1.open1_mean_cat_all#10.week_from_opening_7_5_2 = "5" 1.open1_mean_cat_all#11.week_from_opening_7_5_2  = "6" 1.open1_mean_cat_all#12.week_from_opening_7_5_2 = "7" 1.open1_mean_cat_all#13.week_from_opening_7_5_2 = "8" 1.open1_mean_cat_all#14.week_from_opening_7_5_2 = "9" 1.open1_mean_cat_all#15.week_from_opening_7_5_2 = "10" 1.open1_mean_cat_all#16.week_from_opening_7_5_2 = "11" 1.open1_mean_cat_all#17.week_from_opening_7_5_2 = "12" 1.open1_mean_cat_all#18.week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)


graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - MW Change from Baseline - 0-9 years - 210412.gph"
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - MW Change from Baseline - 0-9 years - 210412.jpg", as(jpg) name("Graph") quality(100)






**S region
*running it once and saving the estimates as hybrid
reg cases_per_pop_bl_0_9_diff i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if region == 3, vce(cluster fips)

estimates store change_bl_hybrid_S_0_9

*running it again and saving the estimates as traditional
reg cases_per_pop_bl_0_9_diff i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if region == 3, vce(cluster fips)

estimates store change_bl_trad_S_0_9

**PLOTTING THE COEFFICIENTS*****
coefplot (change_bl_hybrid_S_0_9, keep(1.open1_mean_cat_all#1.week_from_opening_7_5_2 1.open1_mean_cat_all#2.week_from_opening_7_5_2 1.open1_mean_cat_all#3.week_from_opening_7_5_2 1.open1_mean_cat_all#4.week_from_opening_7_5_2 1.open1_mean_cat_all#5.week_from_opening_7_5_2 1.open1_mean_cat_all#6.week_from_opening_7_5_2 1.open1_mean_cat_all#7.week_from_opening_7_5_2 1.open1_mean_cat_all#8.week_from_opening_7_5_2 1.open1_mean_cat_all#9.week_from_opening_7_5_2 1.open1_mean_cat_all#10.week_from_opening_7_5_2 1.open1_mean_cat_all#11.week_from_opening_7_5_2 1.open1_mean_cat_all#12.week_from_opening_7_5_2 1.open1_mean_cat_all#13.week_from_opening_7_5_2 1.open1_mean_cat_all#14.week_from_opening_7_5_2 1.open1_mean_cat_all#15.week_from_opening_7_5_2 1.open1_mean_cat_all#16.week_from_opening_7_5_2 1.open1_mean_cat_all#17.week_from_opening_7_5_2 1.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Hybrid) mlcolor(black) mcolor(gs12) ciopts(color(gs10)))   (change_bl_trad_S_0_9, keep(2.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Traditional) mlcolor(black) mcolor(gs5) ciopts(color(gs5))), yline(0, lcolor(black) lpattern(dash)) ylabel(-0.005(0.005)0.01) yscale(range(-0.005(0.005)0.01)) vertical rename(2.open1_mean_cat_all#1.week_from_opening_7_5_2 = 1.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 = 1.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 = 1.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 = 1.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 = 1.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 = 1.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 = 1.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 = 1.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 = 1.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 = 1.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 = 1.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 = 1.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 = 1.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 = 1.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 = 1.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 = 1.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 = 1.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2 = 1.open1_mean_cat_all#18.week_from_opening_7_5_2) coeflabels(1.open1_mean_cat_all#1.week_from_opening_7_5_2 = "-4" 1.open1_mean_cat_all#2.week_from_opening_7_5_2 = "-3" 1.open1_mean_cat_all#3.week_from_opening_7_5_2 = "-2" 1.open1_mean_cat_all#4.week_from_opening_7_5_2 = "-1" 1.open1_mean_cat_all#5.week_from_opening_7_5_2 = "0" 1.open1_mean_cat_all#6.week_from_opening_7_5_2 = "1" 1.open1_mean_cat_all#7.week_from_opening_7_5_2 = "2" 1.open1_mean_cat_all#8.week_from_opening_7_5_2 = "3" 1.open1_mean_cat_all#9.week_from_opening_7_5_2 = "4" 1.open1_mean_cat_all#10.week_from_opening_7_5_2 = "5" 1.open1_mean_cat_all#11.week_from_opening_7_5_2  = "6" 1.open1_mean_cat_all#12.week_from_opening_7_5_2 = "7" 1.open1_mean_cat_all#13.week_from_opening_7_5_2 = "8" 1.open1_mean_cat_all#14.week_from_opening_7_5_2 = "9" 1.open1_mean_cat_all#15.week_from_opening_7_5_2 = "10" 1.open1_mean_cat_all#16.week_from_opening_7_5_2 = "11" 1.open1_mean_cat_all#17.week_from_opening_7_5_2 = "12" 1.open1_mean_cat_all#18.week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)


graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - S Change from Baseline - 0-9 years - 210412.gph"
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - S Change from Baseline - 0-9 years - 210412.jpg", as(jpg) name("Graph") quality(100)





******************
**Age 10-19 years***
******************


**overall
*running it once and saving the estimates as hybrid
reg cases_per_pop_bl_10_19_diff i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips, vce(cluster fips)

estimates store change_bl_hybr_all_10_19

*running it again and saving the estimates as traditional
reg cases_per_pop_bl_10_19_diff i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips, vce(cluster fips)

estimates store change_bl_trad_all_10_19

**PLOTTING THE COEFFICIENTS*****
coefplot (change_bl_hybr_all_10_19, keep(1.open1_mean_cat_all#1.week_from_opening_7_5_2 1.open1_mean_cat_all#2.week_from_opening_7_5_2 1.open1_mean_cat_all#3.week_from_opening_7_5_2 1.open1_mean_cat_all#4.week_from_opening_7_5_2 1.open1_mean_cat_all#5.week_from_opening_7_5_2 1.open1_mean_cat_all#6.week_from_opening_7_5_2 1.open1_mean_cat_all#7.week_from_opening_7_5_2 1.open1_mean_cat_all#8.week_from_opening_7_5_2 1.open1_mean_cat_all#9.week_from_opening_7_5_2 1.open1_mean_cat_all#10.week_from_opening_7_5_2 1.open1_mean_cat_all#11.week_from_opening_7_5_2 1.open1_mean_cat_all#12.week_from_opening_7_5_2 1.open1_mean_cat_all#13.week_from_opening_7_5_2 1.open1_mean_cat_all#14.week_from_opening_7_5_2 1.open1_mean_cat_all#15.week_from_opening_7_5_2 1.open1_mean_cat_all#16.week_from_opening_7_5_2 1.open1_mean_cat_all#17.week_from_opening_7_5_2 1.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Hybrid) mlcolor(black) mcolor(gs12) ciopts(color(gs10)))   (change_bl_trad_all_10_19, keep(2.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Traditional) mlcolor(black) mcolor(gs5) ciopts(color(gs5))), yline(0, lcolor(black) lpattern(dash)) ylabel(-0.02(0.01)0.03) yscale(range(-0.02(0.01)0.03)) vertical rename(2.open1_mean_cat_all#1.week_from_opening_7_5_2 = 1.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 = 1.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 = 1.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 = 1.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 = 1.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 = 1.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 = 1.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 = 1.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 = 1.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 = 1.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 = 1.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 = 1.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 = 1.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 = 1.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 = 1.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 = 1.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 = 1.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2 = 1.open1_mean_cat_all#18.week_from_opening_7_5_2) coeflabels(1.open1_mean_cat_all#1.week_from_opening_7_5_2 = "-4" 1.open1_mean_cat_all#2.week_from_opening_7_5_2 = "-3" 1.open1_mean_cat_all#3.week_from_opening_7_5_2 = "-2" 1.open1_mean_cat_all#4.week_from_opening_7_5_2 = "-1" 1.open1_mean_cat_all#5.week_from_opening_7_5_2 = "0" 1.open1_mean_cat_all#6.week_from_opening_7_5_2 = "1" 1.open1_mean_cat_all#7.week_from_opening_7_5_2 = "2" 1.open1_mean_cat_all#8.week_from_opening_7_5_2 = "3" 1.open1_mean_cat_all#9.week_from_opening_7_5_2 = "4" 1.open1_mean_cat_all#10.week_from_opening_7_5_2 = "5" 1.open1_mean_cat_all#11.week_from_opening_7_5_2  = "6" 1.open1_mean_cat_all#12.week_from_opening_7_5_2 = "7" 1.open1_mean_cat_all#13.week_from_opening_7_5_2 = "8" 1.open1_mean_cat_all#14.week_from_opening_7_5_2 = "9" 1.open1_mean_cat_all#15.week_from_opening_7_5_2 = "10" 1.open1_mean_cat_all#16.week_from_opening_7_5_2 = "11" 1.open1_mean_cat_all#17.week_from_opening_7_5_2 = "12" 1.open1_mean_cat_all#18.week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)


graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Overall Change from Baseline - 10-19 years - 210412.gph", replace
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Overall Change from Baseline - 10-19 years - 210412.jpg", as(jpg) name("Graph") quality(100) replace






**NE region
*running it once and saving the estimates as hybrid
reg cases_per_pop_bl_10_19_diff i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if region == 0, vce(cluster fips)

estimates store change_bl_hybrid_NE_10_19

*running it again and saving the estimates as traditional
reg cases_per_pop_bl_10_19_diff i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if region == 0, vce(cluster fips)

estimates store change_bl_trad_NE_10_19

**PLOTTING THE COEFFICIENTS*****
coefplot (change_bl_hybrid_NE_10_19, keep(1.open1_mean_cat_all#1.week_from_opening_7_5_2 1.open1_mean_cat_all#2.week_from_opening_7_5_2 1.open1_mean_cat_all#3.week_from_opening_7_5_2 1.open1_mean_cat_all#4.week_from_opening_7_5_2 1.open1_mean_cat_all#5.week_from_opening_7_5_2 1.open1_mean_cat_all#6.week_from_opening_7_5_2 1.open1_mean_cat_all#7.week_from_opening_7_5_2 1.open1_mean_cat_all#8.week_from_opening_7_5_2 1.open1_mean_cat_all#9.week_from_opening_7_5_2 1.open1_mean_cat_all#10.week_from_opening_7_5_2 1.open1_mean_cat_all#11.week_from_opening_7_5_2 1.open1_mean_cat_all#12.week_from_opening_7_5_2 1.open1_mean_cat_all#13.week_from_opening_7_5_2 1.open1_mean_cat_all#14.week_from_opening_7_5_2 1.open1_mean_cat_all#15.week_from_opening_7_5_2 1.open1_mean_cat_all#16.week_from_opening_7_5_2 1.open1_mean_cat_all#17.week_from_opening_7_5_2 1.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Hybrid) mlcolor(black) mcolor(gs12) ciopts(color(gs10)))   (change_bl_trad_NE_10_19, keep(2.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Traditional) mlcolor(black) mcolor(gs5) ciopts(color(gs5))), yline(0, lcolor(black) lpattern(dash)) ylabel(-0.04(0.02)0.10) yscale(range(-0.04(0.02)0.10)) vertical rename(2.open1_mean_cat_all#1.week_from_opening_7_5_2 = 1.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 = 1.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 = 1.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 = 1.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 = 1.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 = 1.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 = 1.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 = 1.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 = 1.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 = 1.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 = 1.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 = 1.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 = 1.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 = 1.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 = 1.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 = 1.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 = 1.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2 = 1.open1_mean_cat_all#18.week_from_opening_7_5_2) coeflabels(1.open1_mean_cat_all#1.week_from_opening_7_5_2 = "-4" 1.open1_mean_cat_all#2.week_from_opening_7_5_2 = "-3" 1.open1_mean_cat_all#3.week_from_opening_7_5_2 = "-2" 1.open1_mean_cat_all#4.week_from_opening_7_5_2 = "-1" 1.open1_mean_cat_all#5.week_from_opening_7_5_2 = "0" 1.open1_mean_cat_all#6.week_from_opening_7_5_2 = "1" 1.open1_mean_cat_all#7.week_from_opening_7_5_2 = "2" 1.open1_mean_cat_all#8.week_from_opening_7_5_2 = "3" 1.open1_mean_cat_all#9.week_from_opening_7_5_2 = "4" 1.open1_mean_cat_all#10.week_from_opening_7_5_2 = "5" 1.open1_mean_cat_all#11.week_from_opening_7_5_2  = "6" 1.open1_mean_cat_all#12.week_from_opening_7_5_2 = "7" 1.open1_mean_cat_all#13.week_from_opening_7_5_2 = "8" 1.open1_mean_cat_all#14.week_from_opening_7_5_2 = "9" 1.open1_mean_cat_all#15.week_from_opening_7_5_2 = "10" 1.open1_mean_cat_all#16.week_from_opening_7_5_2 = "11" 1.open1_mean_cat_all#17.week_from_opening_7_5_2 = "12" 1.open1_mean_cat_all#18.week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)


graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - NE Change from Baseline - 10-19 years - 210412.gph"
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - NE Change from Baseline - 10-19 years - 210412.jpg", as(jpg) name("Graph") quality(100)







**W region
*running it once and saving the estimates as hybrid
reg cases_per_pop_bl_10_19_diff i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if region == 1, vce(cluster fips)

estimates store change_bl_hybrid_W_10_19

*running it again and saving the estimates as traditional
reg cases_per_pop_bl_10_19_diff i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if region == 1, vce(cluster fips)

estimates store change_bl_trad_W_10_19

**PLOTTING THE COEFFICIENTS*****
coefplot (change_bl_hybrid_W_10_19, keep(1.open1_mean_cat_all#1.week_from_opening_7_5_2 1.open1_mean_cat_all#2.week_from_opening_7_5_2 1.open1_mean_cat_all#3.week_from_opening_7_5_2 1.open1_mean_cat_all#4.week_from_opening_7_5_2 1.open1_mean_cat_all#5.week_from_opening_7_5_2 1.open1_mean_cat_all#6.week_from_opening_7_5_2 1.open1_mean_cat_all#7.week_from_opening_7_5_2 1.open1_mean_cat_all#8.week_from_opening_7_5_2 1.open1_mean_cat_all#9.week_from_opening_7_5_2 1.open1_mean_cat_all#10.week_from_opening_7_5_2 1.open1_mean_cat_all#11.week_from_opening_7_5_2 1.open1_mean_cat_all#12.week_from_opening_7_5_2 1.open1_mean_cat_all#13.week_from_opening_7_5_2 1.open1_mean_cat_all#14.week_from_opening_7_5_2 1.open1_mean_cat_all#15.week_from_opening_7_5_2 1.open1_mean_cat_all#16.week_from_opening_7_5_2 1.open1_mean_cat_all#17.week_from_opening_7_5_2 1.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Hybrid) mlcolor(black) mcolor(gs12) ciopts(color(gs10)))   (change_bl_trad_W_10_19, keep(2.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Traditional) mlcolor(black) mcolor(gs5) ciopts(color(gs5))), yline(0, lcolor(black) lpattern(dash)) ylabel(-0.05(0.05)0.15) yscale(range(-0.005(0.005)0.025)) vertical rename(2.open1_mean_cat_all#1.week_from_opening_7_5_2 = 1.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 = 1.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 = 1.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 = 1.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 = 1.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 = 1.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 = 1.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 = 1.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 = 1.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 = 1.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 = 1.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 = 1.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 = 1.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 = 1.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 = 1.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 = 1.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 = 1.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2 = 1.open1_mean_cat_all#18.week_from_opening_7_5_2) coeflabels(1.open1_mean_cat_all#1.week_from_opening_7_5_2 = "-4" 1.open1_mean_cat_all#2.week_from_opening_7_5_2 = "-3" 1.open1_mean_cat_all#3.week_from_opening_7_5_2 = "-2" 1.open1_mean_cat_all#4.week_from_opening_7_5_2 = "-1" 1.open1_mean_cat_all#5.week_from_opening_7_5_2 = "0" 1.open1_mean_cat_all#6.week_from_opening_7_5_2 = "1" 1.open1_mean_cat_all#7.week_from_opening_7_5_2 = "2" 1.open1_mean_cat_all#8.week_from_opening_7_5_2 = "3" 1.open1_mean_cat_all#9.week_from_opening_7_5_2 = "4" 1.open1_mean_cat_all#10.week_from_opening_7_5_2 = "5" 1.open1_mean_cat_all#11.week_from_opening_7_5_2  = "6" 1.open1_mean_cat_all#12.week_from_opening_7_5_2 = "7" 1.open1_mean_cat_all#13.week_from_opening_7_5_2 = "8" 1.open1_mean_cat_all#14.week_from_opening_7_5_2 = "9" 1.open1_mean_cat_all#15.week_from_opening_7_5_2 = "10" 1.open1_mean_cat_all#16.week_from_opening_7_5_2 = "11" 1.open1_mean_cat_all#17.week_from_opening_7_5_2 = "12" 1.open1_mean_cat_all#18.week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)

graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - W Change from Baseline - 10-19 years - 210412.gph"
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - W Change from Baseline - 10-19 years - 210412.jpg", as(jpg) name("Graph") quality(100)







**MW region
*running it once and saving the estimates as hybrid
reg cases_per_pop_bl_10_19_diff i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if region == 2, vce(cluster fips)

estimates store change_bl_hybrid_MW_10_19

*running it again and saving the estimates as traditional
reg cases_per_pop_bl_10_19_diff i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if region == 2, vce(cluster fips)

estimates store change_bl_trad_MW_10_19

**PLOTTING THE COEFFICIENTS*****
coefplot (change_bl_hybrid_MW_10_19, keep(1.open1_mean_cat_all#1.week_from_opening_7_5_2 1.open1_mean_cat_all#2.week_from_opening_7_5_2 1.open1_mean_cat_all#3.week_from_opening_7_5_2 1.open1_mean_cat_all#4.week_from_opening_7_5_2 1.open1_mean_cat_all#5.week_from_opening_7_5_2 1.open1_mean_cat_all#6.week_from_opening_7_5_2 1.open1_mean_cat_all#7.week_from_opening_7_5_2 1.open1_mean_cat_all#8.week_from_opening_7_5_2 1.open1_mean_cat_all#9.week_from_opening_7_5_2 1.open1_mean_cat_all#10.week_from_opening_7_5_2 1.open1_mean_cat_all#11.week_from_opening_7_5_2 1.open1_mean_cat_all#12.week_from_opening_7_5_2 1.open1_mean_cat_all#13.week_from_opening_7_5_2 1.open1_mean_cat_all#14.week_from_opening_7_5_2 1.open1_mean_cat_all#15.week_from_opening_7_5_2 1.open1_mean_cat_all#16.week_from_opening_7_5_2 1.open1_mean_cat_all#17.week_from_opening_7_5_2 1.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Hybrid) mlcolor(black) mcolor(gs12) ciopts(color(gs10)))   (change_bl_trad_MW_10_19, keep(2.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Traditional) mlcolor(black) mcolor(gs5) ciopts(color(gs5))), yline(0, lcolor(black) lpattern(dash)) ylabel(-0.1(0.05)0.05) yscale(range(-0.025(0.005)0.015)) vertical rename(2.open1_mean_cat_all#1.week_from_opening_7_5_2 = 1.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 = 1.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 = 1.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 = 1.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 = 1.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 = 1.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 = 1.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 = 1.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 = 1.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 = 1.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 = 1.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 = 1.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 = 1.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 = 1.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 = 1.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 = 1.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 = 1.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2 = 1.open1_mean_cat_all#18.week_from_opening_7_5_2) coeflabels(1.open1_mean_cat_all#1.week_from_opening_7_5_2 = "-4" 1.open1_mean_cat_all#2.week_from_opening_7_5_2 = "-3" 1.open1_mean_cat_all#3.week_from_opening_7_5_2 = "-2" 1.open1_mean_cat_all#4.week_from_opening_7_5_2 = "-1" 1.open1_mean_cat_all#5.week_from_opening_7_5_2 = "0" 1.open1_mean_cat_all#6.week_from_opening_7_5_2 = "1" 1.open1_mean_cat_all#7.week_from_opening_7_5_2 = "2" 1.open1_mean_cat_all#8.week_from_opening_7_5_2 = "3" 1.open1_mean_cat_all#9.week_from_opening_7_5_2 = "4" 1.open1_mean_cat_all#10.week_from_opening_7_5_2 = "5" 1.open1_mean_cat_all#11.week_from_opening_7_5_2  = "6" 1.open1_mean_cat_all#12.week_from_opening_7_5_2 = "7" 1.open1_mean_cat_all#13.week_from_opening_7_5_2 = "8" 1.open1_mean_cat_all#14.week_from_opening_7_5_2 = "9" 1.open1_mean_cat_all#15.week_from_opening_7_5_2 = "10" 1.open1_mean_cat_all#16.week_from_opening_7_5_2 = "11" 1.open1_mean_cat_all#17.week_from_opening_7_5_2 = "12" 1.open1_mean_cat_all#18.week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)


graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - MW Change from Baseline - 10-19 years - 210413.gph"
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - MW Change from Baseline - 10-19 years - 210413.jpg", as(jpg) name("Graph") quality(100)






**S region
*running it once and saving the estimates as hybrid
reg cases_per_pop_bl_10_19_diff i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if region == 3, vce(cluster fips)

estimates store change_bl_hybrid_S_10_19

*running it again and saving the estimates as traditional
reg cases_per_pop_bl_10_19_diff i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if region == 3, vce(cluster fips)

estimates store change_bl_trad_S_10_19

**PLOTTING THE COEFFICIENTS*****
coefplot (change_bl_hybrid_S_10_19, keep(1.open1_mean_cat_all#1.week_from_opening_7_5_2 1.open1_mean_cat_all#2.week_from_opening_7_5_2 1.open1_mean_cat_all#3.week_from_opening_7_5_2 1.open1_mean_cat_all#4.week_from_opening_7_5_2 1.open1_mean_cat_all#5.week_from_opening_7_5_2 1.open1_mean_cat_all#6.week_from_opening_7_5_2 1.open1_mean_cat_all#7.week_from_opening_7_5_2 1.open1_mean_cat_all#8.week_from_opening_7_5_2 1.open1_mean_cat_all#9.week_from_opening_7_5_2 1.open1_mean_cat_all#10.week_from_opening_7_5_2 1.open1_mean_cat_all#11.week_from_opening_7_5_2 1.open1_mean_cat_all#12.week_from_opening_7_5_2 1.open1_mean_cat_all#13.week_from_opening_7_5_2 1.open1_mean_cat_all#14.week_from_opening_7_5_2 1.open1_mean_cat_all#15.week_from_opening_7_5_2 1.open1_mean_cat_all#16.week_from_opening_7_5_2 1.open1_mean_cat_all#17.week_from_opening_7_5_2 1.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Hybrid) mlcolor(black) mcolor(gs12) ciopts(color(gs10)))   (change_bl_trad_S_10_19, keep(2.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Traditional) mlcolor(black) mcolor(gs5) ciopts(color(gs5))), yline(0, lcolor(black) lpattern(dash)) ylabel(-0.04(0.02)0.04) yscale(range(-0.005(0.005)0.01)) vertical rename(2.open1_mean_cat_all#1.week_from_opening_7_5_2 = 1.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 = 1.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 = 1.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 = 1.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 = 1.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 = 1.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 = 1.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 = 1.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 = 1.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 = 1.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 = 1.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 = 1.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 = 1.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 = 1.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 = 1.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 = 1.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 = 1.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2 = 1.open1_mean_cat_all#18.week_from_opening_7_5_2) coeflabels(1.open1_mean_cat_all#1.week_from_opening_7_5_2 = "-4" 1.open1_mean_cat_all#2.week_from_opening_7_5_2 = "-3" 1.open1_mean_cat_all#3.week_from_opening_7_5_2 = "-2" 1.open1_mean_cat_all#4.week_from_opening_7_5_2 = "-1" 1.open1_mean_cat_all#5.week_from_opening_7_5_2 = "0" 1.open1_mean_cat_all#6.week_from_opening_7_5_2 = "1" 1.open1_mean_cat_all#7.week_from_opening_7_5_2 = "2" 1.open1_mean_cat_all#8.week_from_opening_7_5_2 = "3" 1.open1_mean_cat_all#9.week_from_opening_7_5_2 = "4" 1.open1_mean_cat_all#10.week_from_opening_7_5_2 = "5" 1.open1_mean_cat_all#11.week_from_opening_7_5_2  = "6" 1.open1_mean_cat_all#12.week_from_opening_7_5_2 = "7" 1.open1_mean_cat_all#13.week_from_opening_7_5_2 = "8" 1.open1_mean_cat_all#14.week_from_opening_7_5_2 = "9" 1.open1_mean_cat_all#15.week_from_opening_7_5_2 = "10" 1.open1_mean_cat_all#16.week_from_opening_7_5_2 = "11" 1.open1_mean_cat_all#17.week_from_opening_7_5_2 = "12" 1.open1_mean_cat_all#18.week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)


graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - S Change from Baseline - 10-19 years - 210412.gph"
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - S Change from Baseline - 10-19 years - 210412.jpg", as(jpg) name("Graph") quality(100)









******************
**Age 20+ years***
******************


**overall
*running it once and saving the estimates as hybrid
reg cases_per_pop_bl_20_diff i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips, vce(cluster fips)

estimates store change_bl_hybr_all_20

*running it again and saving the estimates as traditional
reg cases_per_pop_bl_20_diff i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips, vce(cluster fips)

estimates store change_bl_trad_all_20

**PLOTTING THE COEFFICIENTS*****
coefplot (change_bl_hybr_all_20, keep(1.open1_mean_cat_all#1.week_from_opening_7_5_2 1.open1_mean_cat_all#2.week_from_opening_7_5_2 1.open1_mean_cat_all#3.week_from_opening_7_5_2 1.open1_mean_cat_all#4.week_from_opening_7_5_2 1.open1_mean_cat_all#5.week_from_opening_7_5_2 1.open1_mean_cat_all#6.week_from_opening_7_5_2 1.open1_mean_cat_all#7.week_from_opening_7_5_2 1.open1_mean_cat_all#8.week_from_opening_7_5_2 1.open1_mean_cat_all#9.week_from_opening_7_5_2 1.open1_mean_cat_all#10.week_from_opening_7_5_2 1.open1_mean_cat_all#11.week_from_opening_7_5_2 1.open1_mean_cat_all#12.week_from_opening_7_5_2 1.open1_mean_cat_all#13.week_from_opening_7_5_2 1.open1_mean_cat_all#14.week_from_opening_7_5_2 1.open1_mean_cat_all#15.week_from_opening_7_5_2 1.open1_mean_cat_all#16.week_from_opening_7_5_2 1.open1_mean_cat_all#17.week_from_opening_7_5_2 1.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Hybrid) mlcolor(black) mcolor(gs12) ciopts(color(gs10)))   (change_bl_trad_all_20, keep(2.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Traditional) mlcolor(black) mcolor(gs5) ciopts(color(gs5))), yline(0, lcolor(black) lpattern(dash)) ylabel(-0.1(0.1)0.3) yscale(range(-0.1(0.1)0.3)) vertical rename(2.open1_mean_cat_all#1.week_from_opening_7_5_2 = 1.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 = 1.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 = 1.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 = 1.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 = 1.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 = 1.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 = 1.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 = 1.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 = 1.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 = 1.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 = 1.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 = 1.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 = 1.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 = 1.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 = 1.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 = 1.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 = 1.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2 = 1.open1_mean_cat_all#18.week_from_opening_7_5_2) coeflabels(1.open1_mean_cat_all#1.week_from_opening_7_5_2 = "-4" 1.open1_mean_cat_all#2.week_from_opening_7_5_2 = "-3" 1.open1_mean_cat_all#3.week_from_opening_7_5_2 = "-2" 1.open1_mean_cat_all#4.week_from_opening_7_5_2 = "-1" 1.open1_mean_cat_all#5.week_from_opening_7_5_2 = "0" 1.open1_mean_cat_all#6.week_from_opening_7_5_2 = "1" 1.open1_mean_cat_all#7.week_from_opening_7_5_2 = "2" 1.open1_mean_cat_all#8.week_from_opening_7_5_2 = "3" 1.open1_mean_cat_all#9.week_from_opening_7_5_2 = "4" 1.open1_mean_cat_all#10.week_from_opening_7_5_2 = "5" 1.open1_mean_cat_all#11.week_from_opening_7_5_2  = "6" 1.open1_mean_cat_all#12.week_from_opening_7_5_2 = "7" 1.open1_mean_cat_all#13.week_from_opening_7_5_2 = "8" 1.open1_mean_cat_all#14.week_from_opening_7_5_2 = "9" 1.open1_mean_cat_all#15.week_from_opening_7_5_2 = "10" 1.open1_mean_cat_all#16.week_from_opening_7_5_2 = "11" 1.open1_mean_cat_all#17.week_from_opening_7_5_2 = "12" 1.open1_mean_cat_all#18.week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)


graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Overall Change from Baseline - 20+ years - 210413.gph", replace
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Overall Change from Baseline - 20+ years - 210413.jpg", as(jpg) name("Graph") quality(100) replace






**NE region
*running it once and saving the estimates as hybrid
reg cases_per_pop_bl_20_diff i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if region == 0, vce(cluster fips)

estimates store change_bl_hybrid_NE_20

*running it again and saving the estimates as traditional
reg cases_per_pop_bl_20_diff i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if region == 0, vce(cluster fips)

estimates store change_bl_trad_NE_20

**PLOTTING THE COEFFICIENTS*****
coefplot (change_bl_hybrid_NE_20, keep(1.open1_mean_cat_all#1.week_from_opening_7_5_2 1.open1_mean_cat_all#2.week_from_opening_7_5_2 1.open1_mean_cat_all#3.week_from_opening_7_5_2 1.open1_mean_cat_all#4.week_from_opening_7_5_2 1.open1_mean_cat_all#5.week_from_opening_7_5_2 1.open1_mean_cat_all#6.week_from_opening_7_5_2 1.open1_mean_cat_all#7.week_from_opening_7_5_2 1.open1_mean_cat_all#8.week_from_opening_7_5_2 1.open1_mean_cat_all#9.week_from_opening_7_5_2 1.open1_mean_cat_all#10.week_from_opening_7_5_2 1.open1_mean_cat_all#11.week_from_opening_7_5_2 1.open1_mean_cat_all#12.week_from_opening_7_5_2 1.open1_mean_cat_all#13.week_from_opening_7_5_2 1.open1_mean_cat_all#14.week_from_opening_7_5_2 1.open1_mean_cat_all#15.week_from_opening_7_5_2 1.open1_mean_cat_all#16.week_from_opening_7_5_2 1.open1_mean_cat_all#17.week_from_opening_7_5_2 1.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Hybrid) mlcolor(black) mcolor(gs12) ciopts(color(gs10)))   (change_bl_trad_NE_20, keep(2.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Traditional) mlcolor(black) mcolor(gs5) ciopts(color(gs5))), yline(0, lcolor(black) lpattern(dash)) ylabel(-0.2(0.1)0.2) yscale(range(-0.2(0.1)0.2)) vertical rename(2.open1_mean_cat_all#1.week_from_opening_7_5_2 = 1.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 = 1.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 = 1.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 = 1.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 = 1.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 = 1.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 = 1.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 = 1.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 = 1.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 = 1.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 = 1.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 = 1.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 = 1.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 = 1.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 = 1.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 = 1.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 = 1.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2 = 1.open1_mean_cat_all#18.week_from_opening_7_5_2) coeflabels(1.open1_mean_cat_all#1.week_from_opening_7_5_2 = "-4" 1.open1_mean_cat_all#2.week_from_opening_7_5_2 = "-3" 1.open1_mean_cat_all#3.week_from_opening_7_5_2 = "-2" 1.open1_mean_cat_all#4.week_from_opening_7_5_2 = "-1" 1.open1_mean_cat_all#5.week_from_opening_7_5_2 = "0" 1.open1_mean_cat_all#6.week_from_opening_7_5_2 = "1" 1.open1_mean_cat_all#7.week_from_opening_7_5_2 = "2" 1.open1_mean_cat_all#8.week_from_opening_7_5_2 = "3" 1.open1_mean_cat_all#9.week_from_opening_7_5_2 = "4" 1.open1_mean_cat_all#10.week_from_opening_7_5_2 = "5" 1.open1_mean_cat_all#11.week_from_opening_7_5_2  = "6" 1.open1_mean_cat_all#12.week_from_opening_7_5_2 = "7" 1.open1_mean_cat_all#13.week_from_opening_7_5_2 = "8" 1.open1_mean_cat_all#14.week_from_opening_7_5_2 = "9" 1.open1_mean_cat_all#15.week_from_opening_7_5_2 = "10" 1.open1_mean_cat_all#16.week_from_opening_7_5_2 = "11" 1.open1_mean_cat_all#17.week_from_opening_7_5_2 = "12" 1.open1_mean_cat_all#18.week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)


graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - NE Change from Baseline - 20+ years - 210413.gph"
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - NE Change from Baseline - 20+ years - 210413.jpg", as(jpg) name("Graph") quality(100)







**W region
*running it once and saving the estimates as hybrid
reg cases_per_pop_bl_20_diff i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if region == 1, vce(cluster fips)

estimates store change_bl_hybrid_W_20

*running it again and saving the estimates as traditional
reg cases_per_pop_bl_20_diff i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if region == 1, vce(cluster fips)

estimates store change_bl_trad_W_20

**PLOTTING THE COEFFICIENTS*****
coefplot (change_bl_hybrid_W_20, keep(1.open1_mean_cat_all#1.week_from_opening_7_5_2 1.open1_mean_cat_all#2.week_from_opening_7_5_2 1.open1_mean_cat_all#3.week_from_opening_7_5_2 1.open1_mean_cat_all#4.week_from_opening_7_5_2 1.open1_mean_cat_all#5.week_from_opening_7_5_2 1.open1_mean_cat_all#6.week_from_opening_7_5_2 1.open1_mean_cat_all#7.week_from_opening_7_5_2 1.open1_mean_cat_all#8.week_from_opening_7_5_2 1.open1_mean_cat_all#9.week_from_opening_7_5_2 1.open1_mean_cat_all#10.week_from_opening_7_5_2 1.open1_mean_cat_all#11.week_from_opening_7_5_2 1.open1_mean_cat_all#12.week_from_opening_7_5_2 1.open1_mean_cat_all#13.week_from_opening_7_5_2 1.open1_mean_cat_all#14.week_from_opening_7_5_2 1.open1_mean_cat_all#15.week_from_opening_7_5_2 1.open1_mean_cat_all#16.week_from_opening_7_5_2 1.open1_mean_cat_all#17.week_from_opening_7_5_2 1.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Hybrid) mlcolor(black) mcolor(gs12) ciopts(color(gs10)))   (change_bl_trad_W_20, keep(2.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Traditional) mlcolor(black) mcolor(gs5) ciopts(color(gs5))), yline(0, lcolor(black) lpattern(dash)) ylabel(-0.2(0.2)0.8) yscale(range(-0.2(0.2)0.8)) vertical rename(2.open1_mean_cat_all#1.week_from_opening_7_5_2 = 1.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 = 1.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 = 1.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 = 1.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 = 1.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 = 1.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 = 1.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 = 1.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 = 1.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 = 1.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 = 1.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 = 1.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 = 1.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 = 1.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 = 1.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 = 1.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 = 1.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2 = 1.open1_mean_cat_all#18.week_from_opening_7_5_2) coeflabels(1.open1_mean_cat_all#1.week_from_opening_7_5_2 = "-4" 1.open1_mean_cat_all#2.week_from_opening_7_5_2 = "-3" 1.open1_mean_cat_all#3.week_from_opening_7_5_2 = "-2" 1.open1_mean_cat_all#4.week_from_opening_7_5_2 = "-1" 1.open1_mean_cat_all#5.week_from_opening_7_5_2 = "0" 1.open1_mean_cat_all#6.week_from_opening_7_5_2 = "1" 1.open1_mean_cat_all#7.week_from_opening_7_5_2 = "2" 1.open1_mean_cat_all#8.week_from_opening_7_5_2 = "3" 1.open1_mean_cat_all#9.week_from_opening_7_5_2 = "4" 1.open1_mean_cat_all#10.week_from_opening_7_5_2 = "5" 1.open1_mean_cat_all#11.week_from_opening_7_5_2  = "6" 1.open1_mean_cat_all#12.week_from_opening_7_5_2 = "7" 1.open1_mean_cat_all#13.week_from_opening_7_5_2 = "8" 1.open1_mean_cat_all#14.week_from_opening_7_5_2 = "9" 1.open1_mean_cat_all#15.week_from_opening_7_5_2 = "10" 1.open1_mean_cat_all#16.week_from_opening_7_5_2 = "11" 1.open1_mean_cat_all#17.week_from_opening_7_5_2 = "12" 1.open1_mean_cat_all#18.week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)

graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - W Change from Baseline - 20+ years - 210413.gph"
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - W Change from Baseline - 20+ years - 210413.jpg", as(jpg) name("Graph") quality(100)







**MW region
*running it once and saving the estimates as hybrid
reg cases_per_pop_bl_20_diff i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if region == 2, vce(cluster fips)

estimates store change_bl_hybrid_MW_20

*running it again and saving the estimates as traditional
reg cases_per_pop_bl_20_diff i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if region == 2, vce(cluster fips)

estimates store change_bl_trad_MW_20

**PLOTTING THE COEFFICIENTS*****
coefplot (change_bl_hybrid_MW_20, keep(1.open1_mean_cat_all#1.week_from_opening_7_5_2 1.open1_mean_cat_all#2.week_from_opening_7_5_2 1.open1_mean_cat_all#3.week_from_opening_7_5_2 1.open1_mean_cat_all#4.week_from_opening_7_5_2 1.open1_mean_cat_all#5.week_from_opening_7_5_2 1.open1_mean_cat_all#6.week_from_opening_7_5_2 1.open1_mean_cat_all#7.week_from_opening_7_5_2 1.open1_mean_cat_all#8.week_from_opening_7_5_2 1.open1_mean_cat_all#9.week_from_opening_7_5_2 1.open1_mean_cat_all#10.week_from_opening_7_5_2 1.open1_mean_cat_all#11.week_from_opening_7_5_2 1.open1_mean_cat_all#12.week_from_opening_7_5_2 1.open1_mean_cat_all#13.week_from_opening_7_5_2 1.open1_mean_cat_all#14.week_from_opening_7_5_2 1.open1_mean_cat_all#15.week_from_opening_7_5_2 1.open1_mean_cat_all#16.week_from_opening_7_5_2 1.open1_mean_cat_all#17.week_from_opening_7_5_2 1.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Hybrid) mlcolor(black) mcolor(gs12) ciopts(color(gs10)))   (change_bl_trad_MW_20, keep(2.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Traditional) mlcolor(black) mcolor(gs5) ciopts(color(gs5))), yline(0, lcolor(black) lpattern(dash)) ylabel(-0.2(0.2)0.6) yscale(range(-0.2(0.2)0.6)) vertical rename(2.open1_mean_cat_all#1.week_from_opening_7_5_2 = 1.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 = 1.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 = 1.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 = 1.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 = 1.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 = 1.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 = 1.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 = 1.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 = 1.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 = 1.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 = 1.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 = 1.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 = 1.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 = 1.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 = 1.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 = 1.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 = 1.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2 = 1.open1_mean_cat_all#18.week_from_opening_7_5_2) coeflabels(1.open1_mean_cat_all#1.week_from_opening_7_5_2 = "-4" 1.open1_mean_cat_all#2.week_from_opening_7_5_2 = "-3" 1.open1_mean_cat_all#3.week_from_opening_7_5_2 = "-2" 1.open1_mean_cat_all#4.week_from_opening_7_5_2 = "-1" 1.open1_mean_cat_all#5.week_from_opening_7_5_2 = "0" 1.open1_mean_cat_all#6.week_from_opening_7_5_2 = "1" 1.open1_mean_cat_all#7.week_from_opening_7_5_2 = "2" 1.open1_mean_cat_all#8.week_from_opening_7_5_2 = "3" 1.open1_mean_cat_all#9.week_from_opening_7_5_2 = "4" 1.open1_mean_cat_all#10.week_from_opening_7_5_2 = "5" 1.open1_mean_cat_all#11.week_from_opening_7_5_2  = "6" 1.open1_mean_cat_all#12.week_from_opening_7_5_2 = "7" 1.open1_mean_cat_all#13.week_from_opening_7_5_2 = "8" 1.open1_mean_cat_all#14.week_from_opening_7_5_2 = "9" 1.open1_mean_cat_all#15.week_from_opening_7_5_2 = "10" 1.open1_mean_cat_all#16.week_from_opening_7_5_2 = "11" 1.open1_mean_cat_all#17.week_from_opening_7_5_2 = "12" 1.open1_mean_cat_all#18.week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)


graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - MW Change from Baseline - 20+ years - 210413.gph"
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - MW Change from Baseline - 20+ years - 210413.jpg", as(jpg) name("Graph") quality(100)






**S region
*running it once and saving the estimates as hybrid
reg cases_per_pop_bl_20_diff i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if region == 3, vce(cluster fips)

estimates store change_bl_hybrid_S_20

*running it again and saving the estimates as traditional
reg cases_per_pop_bl_20_diff i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if region == 3, vce(cluster fips)

estimates store change_bl_trad_S_20

**PLOTTING THE COEFFICIENTS*****
coefplot (change_bl_hybrid_S_20, keep(1.open1_mean_cat_all#1.week_from_opening_7_5_2 1.open1_mean_cat_all#2.week_from_opening_7_5_2 1.open1_mean_cat_all#3.week_from_opening_7_5_2 1.open1_mean_cat_all#4.week_from_opening_7_5_2 1.open1_mean_cat_all#5.week_from_opening_7_5_2 1.open1_mean_cat_all#6.week_from_opening_7_5_2 1.open1_mean_cat_all#7.week_from_opening_7_5_2 1.open1_mean_cat_all#8.week_from_opening_7_5_2 1.open1_mean_cat_all#9.week_from_opening_7_5_2 1.open1_mean_cat_all#10.week_from_opening_7_5_2 1.open1_mean_cat_all#11.week_from_opening_7_5_2 1.open1_mean_cat_all#12.week_from_opening_7_5_2 1.open1_mean_cat_all#13.week_from_opening_7_5_2 1.open1_mean_cat_all#14.week_from_opening_7_5_2 1.open1_mean_cat_all#15.week_from_opening_7_5_2 1.open1_mean_cat_all#16.week_from_opening_7_5_2 1.open1_mean_cat_all#17.week_from_opening_7_5_2 1.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Hybrid) mlcolor(black) mcolor(gs12) ciopts(color(gs10)))   (change_bl_trad_S_20, keep(2.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Traditional) mlcolor(black) mcolor(gs5) ciopts(color(gs5))), yline(0, lcolor(black) lpattern(dash)) ylabel(-0.1(0.05)0.1) yscale(range(-0.1(0.05)0.1)) vertical rename(2.open1_mean_cat_all#1.week_from_opening_7_5_2 = 1.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 = 1.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 = 1.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 = 1.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 = 1.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 = 1.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 = 1.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 = 1.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 = 1.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 = 1.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 = 1.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 = 1.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 = 1.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 = 1.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 = 1.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 = 1.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 = 1.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2 = 1.open1_mean_cat_all#18.week_from_opening_7_5_2) coeflabels(1.open1_mean_cat_all#1.week_from_opening_7_5_2 = "-4" 1.open1_mean_cat_all#2.week_from_opening_7_5_2 = "-3" 1.open1_mean_cat_all#3.week_from_opening_7_5_2 = "-2" 1.open1_mean_cat_all#4.week_from_opening_7_5_2 = "-1" 1.open1_mean_cat_all#5.week_from_opening_7_5_2 = "0" 1.open1_mean_cat_all#6.week_from_opening_7_5_2 = "1" 1.open1_mean_cat_all#7.week_from_opening_7_5_2 = "2" 1.open1_mean_cat_all#8.week_from_opening_7_5_2 = "3" 1.open1_mean_cat_all#9.week_from_opening_7_5_2 = "4" 1.open1_mean_cat_all#10.week_from_opening_7_5_2 = "5" 1.open1_mean_cat_all#11.week_from_opening_7_5_2  = "6" 1.open1_mean_cat_all#12.week_from_opening_7_5_2 = "7" 1.open1_mean_cat_all#13.week_from_opening_7_5_2 = "8" 1.open1_mean_cat_all#14.week_from_opening_7_5_2 = "9" 1.open1_mean_cat_all#15.week_from_opening_7_5_2 = "10" 1.open1_mean_cat_all#16.week_from_opening_7_5_2 = "11" 1.open1_mean_cat_all#17.week_from_opening_7_5_2 = "12" 1.open1_mean_cat_all#18.week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)


graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - S Change from Baseline - 20+ years - 210413.gph"
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - S Change from Baseline - 20+ years - 210413.jpg", as(jpg) name("Graph") quality(100)


















***MASK MANDATE 4
**with mask mandate
*running it once and saving the estimates as hybrid
reg cases_per_pop_log i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if h6_facialcoverings4_all == 1, vce(cluster fips)

estimates store hybrid_maskmandate4

*running it again and saving the estimates as traditional
reg cases_per_pop_log i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if h6_facialcoverings4_all == 1, vce(cluster fips)

estimates store traditional_maskmandate4

**PLOTTING THE COEFFICIENTS*****
coefplot (hybrid_maskmandate4, keep(1.open1_mean_cat_all#1.week_from_opening_7_5_2 1.open1_mean_cat_all#2.week_from_opening_7_5_2 1.open1_mean_cat_all#3.week_from_opening_7_5_2 1.open1_mean_cat_all#4.week_from_opening_7_5_2 1.open1_mean_cat_all#5.week_from_opening_7_5_2 1.open1_mean_cat_all#6.week_from_opening_7_5_2 1.open1_mean_cat_all#7.week_from_opening_7_5_2 1.open1_mean_cat_all#8.week_from_opening_7_5_2 1.open1_mean_cat_all#9.week_from_opening_7_5_2 1.open1_mean_cat_all#10.week_from_opening_7_5_2 1.open1_mean_cat_all#11.week_from_opening_7_5_2 1.open1_mean_cat_all#12.week_from_opening_7_5_2 1.open1_mean_cat_all#13.week_from_opening_7_5_2 1.open1_mean_cat_all#14.week_from_opening_7_5_2 1.open1_mean_cat_all#15.week_from_opening_7_5_2 1.open1_mean_cat_all#16.week_from_opening_7_5_2 1.open1_mean_cat_all#17.week_from_opening_7_5_2 1.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Hybrid) mlcolor(black))   (traditional_maskmandate4, keep(2.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Traditional) mlcolor(black)), yline(0, lcolor(black) lpattern(dash)) vertical rename(2.open1_mean_cat_all#1.week_from_opening_7_5_2 = 1.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 = 1.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 = 1.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 = 1.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 = 1.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 = 1.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 = 1.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 = 1.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 = 1.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 = 1.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 = 1.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 = 1.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 = 1.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 = 1.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 = 1.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 = 1.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 = 1.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2 = 1.open1_mean_cat_all#18.week_from_opening_7_5_2) coeflabels(1.open1_mean_cat_all#1.week_from_opening_7_5_2 = "-4" 1.open1_mean_cat_all#2.week_from_opening_7_5_2 = "-3" 1.open1_mean_cat_all#3.week_from_opening_7_5_2 = "-2" 1.open1_mean_cat_all#4.week_from_opening_7_5_2 = "-1" 1.open1_mean_cat_all#5.week_from_opening_7_5_2 = "0" 1.open1_mean_cat_all#6.week_from_opening_7_5_2 = "1" 1.open1_mean_cat_all#7.week_from_opening_7_5_2 = "2" 1.open1_mean_cat_all#8.week_from_opening_7_5_2 = "3" 1.open1_mean_cat_all#9.week_from_opening_7_5_2 = "4" 1.open1_mean_cat_all#10.week_from_opening_7_5_2 = "5" 1.open1_mean_cat_all#11.week_from_opening_7_5_2  = "6" 1.open1_mean_cat_all#12.week_from_opening_7_5_2 = "7" 1.open1_mean_cat_all#13.week_from_opening_7_5_2 = "8" 1.open1_mean_cat_all#14.week_from_opening_7_5_2 = "9" 1.open1_mean_cat_all#15.week_from_opening_7_5_2 = "10" 1.open1_mean_cat_all#16.week_from_opening_7_5_2 = "11" 1.open1_mean_cat_all#17.week_from_opening_7_5_2 = "12" 1.open1_mean_cat_all#18.week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)


graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Mask Mandate 4 - 210406.gph", replace
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Mask Mandate 4 - 210406.jpg", as(jpg) name("Graph") quality(100) replace




***NE only
**with mask mandate
*running it once and saving the estimates as hybrid
reg cases_per_pop_log i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if h6_facialcoverings4_all == 1 & region == 0, vce(cluster fips)

estimates store hybrid_maskmandate4_ne

*running it again and saving the estimates as traditional
reg cases_per_pop_log i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if h6_facialcoverings4_all == 1 & region == 0, vce(cluster fips)

estimates store traditional_maskmandate4_ne

**PLOTTING THE COEFFICIENTS*****
coefplot (hybrid_maskmandate4_ne, keep(1.open1_mean_cat_all#1.week_from_opening_7_5_2 1.open1_mean_cat_all#2.week_from_opening_7_5_2 1.open1_mean_cat_all#3.week_from_opening_7_5_2 1.open1_mean_cat_all#4.week_from_opening_7_5_2 1.open1_mean_cat_all#5.week_from_opening_7_5_2 1.open1_mean_cat_all#6.week_from_opening_7_5_2 1.open1_mean_cat_all#7.week_from_opening_7_5_2 1.open1_mean_cat_all#8.week_from_opening_7_5_2 1.open1_mean_cat_all#9.week_from_opening_7_5_2 1.open1_mean_cat_all#10.week_from_opening_7_5_2 1.open1_mean_cat_all#11.week_from_opening_7_5_2 1.open1_mean_cat_all#12.week_from_opening_7_5_2 1.open1_mean_cat_all#13.week_from_opening_7_5_2 1.open1_mean_cat_all#14.week_from_opening_7_5_2 1.open1_mean_cat_all#15.week_from_opening_7_5_2 1.open1_mean_cat_all#16.week_from_opening_7_5_2 1.open1_mean_cat_all#17.week_from_opening_7_5_2 1.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Hybrid) mlcolor(black))   (traditional_maskmandate4_ne, keep(2.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Traditional) mlcolor(black)), yline(0, lcolor(black) lpattern(dash)) vertical rename(2.open1_mean_cat_all#1.week_from_opening_7_5_2 = 1.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 = 1.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 = 1.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 = 1.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 = 1.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 = 1.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 = 1.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 = 1.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 = 1.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 = 1.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 = 1.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 = 1.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 = 1.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 = 1.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 = 1.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 = 1.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 = 1.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2 = 1.open1_mean_cat_all#18.week_from_opening_7_5_2) coeflabels(1.open1_mean_cat_all#1.week_from_opening_7_5_2 = "-4" 1.open1_mean_cat_all#2.week_from_opening_7_5_2 = "-3" 1.open1_mean_cat_all#3.week_from_opening_7_5_2 = "-2" 1.open1_mean_cat_all#4.week_from_opening_7_5_2 = "-1" 1.open1_mean_cat_all#5.week_from_opening_7_5_2 = "0" 1.open1_mean_cat_all#6.week_from_opening_7_5_2 = "1" 1.open1_mean_cat_all#7.week_from_opening_7_5_2 = "2" 1.open1_mean_cat_all#8.week_from_opening_7_5_2 = "3" 1.open1_mean_cat_all#9.week_from_opening_7_5_2 = "4" 1.open1_mean_cat_all#10.week_from_opening_7_5_2 = "5" 1.open1_mean_cat_all#11.week_from_opening_7_5_2  = "6" 1.open1_mean_cat_all#12.week_from_opening_7_5_2 = "7" 1.open1_mean_cat_all#13.week_from_opening_7_5_2 = "8" 1.open1_mean_cat_all#14.week_from_opening_7_5_2 = "9" 1.open1_mean_cat_all#15.week_from_opening_7_5_2 = "10" 1.open1_mean_cat_all#16.week_from_opening_7_5_2 = "11" 1.open1_mean_cat_all#17.week_from_opening_7_5_2 = "12" 1.open1_mean_cat_all#18.week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)


graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Mask Mandate 4 - NE - 210406.gph", replace
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Mask Mandate 4 - NE - 210406.jpg", as(jpg) name("Graph") quality(100) replace



**without mask mandate
*running it once and saving the estimates as hybrid
reg cases_per_pop_log i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if h6_facialcoverings4_all == 0 & region == 0, vce(cluster fips)

estimates store hybrid_nomaskmandate4_ne

*running it again and saving the estimates as traditional
reg cases_per_pop_log i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if h6_facialcoverings4_all == 0 & region == 0, vce(cluster fips)

estimates store trad_nomaskmandate4_ne

**PLOTTING THE COEFFICIENTS*****
coefplot (hybrid_nomaskmandate4_ne, keep(1.open1_mean_cat_all#1.week_from_opening_7_5_2 1.open1_mean_cat_all#2.week_from_opening_7_5_2 1.open1_mean_cat_all#3.week_from_opening_7_5_2 1.open1_mean_cat_all#4.week_from_opening_7_5_2 1.open1_mean_cat_all#5.week_from_opening_7_5_2 1.open1_mean_cat_all#6.week_from_opening_7_5_2 1.open1_mean_cat_all#7.week_from_opening_7_5_2 1.open1_mean_cat_all#8.week_from_opening_7_5_2 1.open1_mean_cat_all#9.week_from_opening_7_5_2 1.open1_mean_cat_all#10.week_from_opening_7_5_2 1.open1_mean_cat_all#11.week_from_opening_7_5_2 1.open1_mean_cat_all#12.week_from_opening_7_5_2 1.open1_mean_cat_all#13.week_from_opening_7_5_2 1.open1_mean_cat_all#14.week_from_opening_7_5_2 1.open1_mean_cat_all#15.week_from_opening_7_5_2 1.open1_mean_cat_all#16.week_from_opening_7_5_2 1.open1_mean_cat_all#17.week_from_opening_7_5_2 1.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Hybrid) mlcolor(black))   (trad_nomaskmandate4_ne, keep(2.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Traditional) mlcolor(black)), yline(0, lcolor(black) lpattern(dash)) vertical rename(2.open1_mean_cat_all#1.week_from_opening_7_5_2 = 1.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 = 1.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 = 1.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 = 1.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 = 1.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 = 1.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 = 1.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 = 1.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 = 1.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 = 1.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 = 1.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 = 1.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 = 1.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 = 1.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 = 1.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 = 1.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 = 1.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2 = 1.open1_mean_cat_all#18.week_from_opening_7_5_2) coeflabels(1.open1_mean_cat_all#1.week_from_opening_7_5_2 = "-4" 1.open1_mean_cat_all#2.week_from_opening_7_5_2 = "-3" 1.open1_mean_cat_all#3.week_from_opening_7_5_2 = "-2" 1.open1_mean_cat_all#4.week_from_opening_7_5_2 = "-1" 1.open1_mean_cat_all#5.week_from_opening_7_5_2 = "0" 1.open1_mean_cat_all#6.week_from_opening_7_5_2 = "1" 1.open1_mean_cat_all#7.week_from_opening_7_5_2 = "2" 1.open1_mean_cat_all#8.week_from_opening_7_5_2 = "3" 1.open1_mean_cat_all#9.week_from_opening_7_5_2 = "4" 1.open1_mean_cat_all#10.week_from_opening_7_5_2 = "5" 1.open1_mean_cat_all#11.week_from_opening_7_5_2  = "6" 1.open1_mean_cat_all#12.week_from_opening_7_5_2 = "7" 1.open1_mean_cat_all#13.week_from_opening_7_5_2 = "8" 1.open1_mean_cat_all#14.week_from_opening_7_5_2 = "9" 1.open1_mean_cat_all#15.week_from_opening_7_5_2 = "10" 1.open1_mean_cat_all#16.week_from_opening_7_5_2 = "11" 1.open1_mean_cat_all#17.week_from_opening_7_5_2 = "12" 1.open1_mean_cat_all#18.week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)


graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - No Mask Mandate 4 - NE - 210406.gph", replace
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - No Mask Mandate 4 - NE - 210406.jpg", as(jpg) name("Graph") quality(100) replace





***S only
**with mask mandate
*running it once and saving the estimates as hybrid
reg cases_per_pop_log i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if h6_facialcoverings4_all == 1 & region == 3, vce(cluster fips)

estimates store hybrid_maskmandate4_s

*running it again and saving the estimates as traditional
reg cases_per_pop_log i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if h6_facialcoverings4_all == 1 & region == 3, vce(cluster fips)

estimates store traditional_maskmandate4_s

**PLOTTING THE COEFFICIENTS*****
coefplot (hybrid_maskmandate4_s, keep(1.open1_mean_cat_all#1.week_from_opening_7_5_2 1.open1_mean_cat_all#2.week_from_opening_7_5_2 1.open1_mean_cat_all#3.week_from_opening_7_5_2 1.open1_mean_cat_all#4.week_from_opening_7_5_2 1.open1_mean_cat_all#5.week_from_opening_7_5_2 1.open1_mean_cat_all#6.week_from_opening_7_5_2 1.open1_mean_cat_all#7.week_from_opening_7_5_2 1.open1_mean_cat_all#8.week_from_opening_7_5_2 1.open1_mean_cat_all#9.week_from_opening_7_5_2 1.open1_mean_cat_all#10.week_from_opening_7_5_2 1.open1_mean_cat_all#11.week_from_opening_7_5_2 1.open1_mean_cat_all#12.week_from_opening_7_5_2 1.open1_mean_cat_all#13.week_from_opening_7_5_2 1.open1_mean_cat_all#14.week_from_opening_7_5_2 1.open1_mean_cat_all#15.week_from_opening_7_5_2 1.open1_mean_cat_all#16.week_from_opening_7_5_2 1.open1_mean_cat_all#17.week_from_opening_7_5_2 1.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Hybrid) mlcolor(black))   (traditional_maskmandate4_s, keep(2.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Traditional) mlcolor(black)), yline(0, lcolor(black) lpattern(dash)) vertical rename(2.open1_mean_cat_all#1.week_from_opening_7_5_2 = 1.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 = 1.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 = 1.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 = 1.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 = 1.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 = 1.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 = 1.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 = 1.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 = 1.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 = 1.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 = 1.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 = 1.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 = 1.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 = 1.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 = 1.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 = 1.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 = 1.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2 = 1.open1_mean_cat_all#18.week_from_opening_7_5_2) coeflabels(1.open1_mean_cat_all#1.week_from_opening_7_5_2 = "-4" 1.open1_mean_cat_all#2.week_from_opening_7_5_2 = "-3" 1.open1_mean_cat_all#3.week_from_opening_7_5_2 = "-2" 1.open1_mean_cat_all#4.week_from_opening_7_5_2 = "-1" 1.open1_mean_cat_all#5.week_from_opening_7_5_2 = "0" 1.open1_mean_cat_all#6.week_from_opening_7_5_2 = "1" 1.open1_mean_cat_all#7.week_from_opening_7_5_2 = "2" 1.open1_mean_cat_all#8.week_from_opening_7_5_2 = "3" 1.open1_mean_cat_all#9.week_from_opening_7_5_2 = "4" 1.open1_mean_cat_all#10.week_from_opening_7_5_2 = "5" 1.open1_mean_cat_all#11.week_from_opening_7_5_2  = "6" 1.open1_mean_cat_all#12.week_from_opening_7_5_2 = "7" 1.open1_mean_cat_all#13.week_from_opening_7_5_2 = "8" 1.open1_mean_cat_all#14.week_from_opening_7_5_2 = "9" 1.open1_mean_cat_all#15.week_from_opening_7_5_2 = "10" 1.open1_mean_cat_all#16.week_from_opening_7_5_2 = "11" 1.open1_mean_cat_all#17.week_from_opening_7_5_2 = "12" 1.open1_mean_cat_all#18.week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)


graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Mask Mandate 4 - S - 210406.gph", replace
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Mask Mandate 4 - S - 210406.jpg", as(jpg) name("Graph") quality(100) replace



**without mask mandate
*running it once and saving the estimates as hybrid
reg cases_per_pop_log i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if h6_facialcoverings4_all == 0 & region == 3, vce(cluster fips)

estimates store hybrid_nomaskmandate4_s

*running it again and saving the estimates as traditional
reg cases_per_pop_log i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if h6_facialcoverings4_all == 0 & region == 3, vce(cluster fips)

estimates store trad_nomaskmandate4_s

**PLOTTING THE COEFFICIENTS*****
coefplot (hybrid_nomaskmandate4_s, keep(1.open1_mean_cat_all#1.week_from_opening_7_5_2 1.open1_mean_cat_all#2.week_from_opening_7_5_2 1.open1_mean_cat_all#3.week_from_opening_7_5_2 1.open1_mean_cat_all#4.week_from_opening_7_5_2 1.open1_mean_cat_all#5.week_from_opening_7_5_2 1.open1_mean_cat_all#6.week_from_opening_7_5_2 1.open1_mean_cat_all#7.week_from_opening_7_5_2 1.open1_mean_cat_all#8.week_from_opening_7_5_2 1.open1_mean_cat_all#9.week_from_opening_7_5_2 1.open1_mean_cat_all#10.week_from_opening_7_5_2 1.open1_mean_cat_all#11.week_from_opening_7_5_2 1.open1_mean_cat_all#12.week_from_opening_7_5_2 1.open1_mean_cat_all#13.week_from_opening_7_5_2 1.open1_mean_cat_all#14.week_from_opening_7_5_2 1.open1_mean_cat_all#15.week_from_opening_7_5_2 1.open1_mean_cat_all#16.week_from_opening_7_5_2 1.open1_mean_cat_all#17.week_from_opening_7_5_2 1.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Hybrid) mlcolor(black))   (trad_nomaskmandate4_s, keep(2.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Traditional) mlcolor(black)), yline(0, lcolor(black) lpattern(dash)) vertical rename(2.open1_mean_cat_all#1.week_from_opening_7_5_2 = 1.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 = 1.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 = 1.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 = 1.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 = 1.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 = 1.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 = 1.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 = 1.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 = 1.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 = 1.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 = 1.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 = 1.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 = 1.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 = 1.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 = 1.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 = 1.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 = 1.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2 = 1.open1_mean_cat_all#18.week_from_opening_7_5_2) coeflabels(1.open1_mean_cat_all#1.week_from_opening_7_5_2 = "-4" 1.open1_mean_cat_all#2.week_from_opening_7_5_2 = "-3" 1.open1_mean_cat_all#3.week_from_opening_7_5_2 = "-2" 1.open1_mean_cat_all#4.week_from_opening_7_5_2 = "-1" 1.open1_mean_cat_all#5.week_from_opening_7_5_2 = "0" 1.open1_mean_cat_all#6.week_from_opening_7_5_2 = "1" 1.open1_mean_cat_all#7.week_from_opening_7_5_2 = "2" 1.open1_mean_cat_all#8.week_from_opening_7_5_2 = "3" 1.open1_mean_cat_all#9.week_from_opening_7_5_2 = "4" 1.open1_mean_cat_all#10.week_from_opening_7_5_2 = "5" 1.open1_mean_cat_all#11.week_from_opening_7_5_2  = "6" 1.open1_mean_cat_all#12.week_from_opening_7_5_2 = "7" 1.open1_mean_cat_all#13.week_from_opening_7_5_2 = "8" 1.open1_mean_cat_all#14.week_from_opening_7_5_2 = "9" 1.open1_mean_cat_all#15.week_from_opening_7_5_2 = "10" 1.open1_mean_cat_all#16.week_from_opening_7_5_2 = "11" 1.open1_mean_cat_all#17.week_from_opening_7_5_2 = "12" 1.open1_mean_cat_all#18.week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)


graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - No Mask Mandate 4 - S - 210406.gph", replace
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - No Mask Mandate 4 - S - 210406.jpg", as(jpg) name("Graph") quality(100) replace











***MASK MANDATE 3&4
**with mask mandate
*running it once and saving the estimates as hybrid
reg cases_per_pop_log i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if h6_facialcoverings34_all == 1, vce(cluster fips)

estimates store hybrid_maskmandate34

*running it again and saving the estimates as traditional
reg cases_per_pop_log i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if h6_facialcoverings34_all == 1, vce(cluster fips)

estimates store traditional_maskmandate34

**PLOTTING THE COEFFICIENTS*****
coefplot (hybrid_maskmandate34, keep(1.open1_mean_cat_all#1.week_from_opening_7_5_2 1.open1_mean_cat_all#2.week_from_opening_7_5_2 1.open1_mean_cat_all#3.week_from_opening_7_5_2 1.open1_mean_cat_all#4.week_from_opening_7_5_2 1.open1_mean_cat_all#5.week_from_opening_7_5_2 1.open1_mean_cat_all#6.week_from_opening_7_5_2 1.open1_mean_cat_all#7.week_from_opening_7_5_2 1.open1_mean_cat_all#8.week_from_opening_7_5_2 1.open1_mean_cat_all#9.week_from_opening_7_5_2 1.open1_mean_cat_all#10.week_from_opening_7_5_2 1.open1_mean_cat_all#11.week_from_opening_7_5_2 1.open1_mean_cat_all#12.week_from_opening_7_5_2 1.open1_mean_cat_all#13.week_from_opening_7_5_2 1.open1_mean_cat_all#14.week_from_opening_7_5_2 1.open1_mean_cat_all#15.week_from_opening_7_5_2 1.open1_mean_cat_all#16.week_from_opening_7_5_2 1.open1_mean_cat_all#17.week_from_opening_7_5_2 1.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Hybrid) mlcolor(black))   (traditional_maskmandate34, keep(2.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Traditional) mlcolor(black)), yline(0, lcolor(black) lpattern(dash)) vertical rename(2.open1_mean_cat_all#1.week_from_opening_7_5_2 = 1.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 = 1.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 = 1.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 = 1.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 = 1.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 = 1.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 = 1.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 = 1.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 = 1.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 = 1.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 = 1.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 = 1.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 = 1.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 = 1.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 = 1.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 = 1.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 = 1.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2 = 1.open1_mean_cat_all#18.week_from_opening_7_5_2) coeflabels(1.open1_mean_cat_all#1.week_from_opening_7_5_2 = "-4" 1.open1_mean_cat_all#2.week_from_opening_7_5_2 = "-3" 1.open1_mean_cat_all#3.week_from_opening_7_5_2 = "-2" 1.open1_mean_cat_all#4.week_from_opening_7_5_2 = "-1" 1.open1_mean_cat_all#5.week_from_opening_7_5_2 = "0" 1.open1_mean_cat_all#6.week_from_opening_7_5_2 = "1" 1.open1_mean_cat_all#7.week_from_opening_7_5_2 = "2" 1.open1_mean_cat_all#8.week_from_opening_7_5_2 = "3" 1.open1_mean_cat_all#9.week_from_opening_7_5_2 = "4" 1.open1_mean_cat_all#10.week_from_opening_7_5_2 = "5" 1.open1_mean_cat_all#11.week_from_opening_7_5_2  = "6" 1.open1_mean_cat_all#12.week_from_opening_7_5_2 = "7" 1.open1_mean_cat_all#13.week_from_opening_7_5_2 = "8" 1.open1_mean_cat_all#14.week_from_opening_7_5_2 = "9" 1.open1_mean_cat_all#15.week_from_opening_7_5_2 = "10" 1.open1_mean_cat_all#16.week_from_opening_7_5_2 = "11" 1.open1_mean_cat_all#17.week_from_opening_7_5_2 = "12" 1.open1_mean_cat_all#18.week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)


graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Mask Mandate 3&4 - 210406.gph"
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Mask Mandate 3&4 - 210406.jpg", as(jpg) name("Graph") quality(100)




**without mask mandate
*running it once and saving the estimates as hybrid
reg cases_per_pop_log i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if h6_facialcoverings34_all == 0, vce(cluster fips)

estimates store hybrid_nomaskmandate34

*running it again and saving the estimates as traditional
reg cases_per_pop_log i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if h6_facialcoverings34_all == 0, vce(cluster fips)

estimates store traditional_nomaskmandate34

**PLOTTING THE COEFFICIENTS*****
coefplot (hybrid_nomaskmandate34, keep(1.open1_mean_cat_all#1.week_from_opening_7_5_2 1.open1_mean_cat_all#2.week_from_opening_7_5_2 1.open1_mean_cat_all#3.week_from_opening_7_5_2 1.open1_mean_cat_all#4.week_from_opening_7_5_2 1.open1_mean_cat_all#5.week_from_opening_7_5_2 1.open1_mean_cat_all#6.week_from_opening_7_5_2 1.open1_mean_cat_all#7.week_from_opening_7_5_2 1.open1_mean_cat_all#8.week_from_opening_7_5_2 1.open1_mean_cat_all#9.week_from_opening_7_5_2 1.open1_mean_cat_all#10.week_from_opening_7_5_2 1.open1_mean_cat_all#11.week_from_opening_7_5_2 1.open1_mean_cat_all#12.week_from_opening_7_5_2 1.open1_mean_cat_all#13.week_from_opening_7_5_2 1.open1_mean_cat_all#14.week_from_opening_7_5_2 1.open1_mean_cat_all#15.week_from_opening_7_5_2 1.open1_mean_cat_all#16.week_from_opening_7_5_2 1.open1_mean_cat_all#17.week_from_opening_7_5_2 1.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Hybrid) mlcolor(black))   (traditional_nomaskmandate34, keep(2.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Traditional) mlcolor(black)), yline(0, lcolor(black) lpattern(dash)) vertical rename(2.open1_mean_cat_all#1.week_from_opening_7_5_2 = 1.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 = 1.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 = 1.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 = 1.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 = 1.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 = 1.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 = 1.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 = 1.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 = 1.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 = 1.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 = 1.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 = 1.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 = 1.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 = 1.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 = 1.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 = 1.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 = 1.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2 = 1.open1_mean_cat_all#18.week_from_opening_7_5_2) coeflabels(1.open1_mean_cat_all#1.week_from_opening_7_5_2 = "-4" 1.open1_mean_cat_all#2.week_from_opening_7_5_2 = "-3" 1.open1_mean_cat_all#3.week_from_opening_7_5_2 = "-2" 1.open1_mean_cat_all#4.week_from_opening_7_5_2 = "-1" 1.open1_mean_cat_all#5.week_from_opening_7_5_2 = "0" 1.open1_mean_cat_all#6.week_from_opening_7_5_2 = "1" 1.open1_mean_cat_all#7.week_from_opening_7_5_2 = "2" 1.open1_mean_cat_all#8.week_from_opening_7_5_2 = "3" 1.open1_mean_cat_all#9.week_from_opening_7_5_2 = "4" 1.open1_mean_cat_all#10.week_from_opening_7_5_2 = "5" 1.open1_mean_cat_all#11.week_from_opening_7_5_2  = "6" 1.open1_mean_cat_all#12.week_from_opening_7_5_2 = "7" 1.open1_mean_cat_all#13.week_from_opening_7_5_2 = "8" 1.open1_mean_cat_all#14.week_from_opening_7_5_2 = "9" 1.open1_mean_cat_all#15.week_from_opening_7_5_2 = "10" 1.open1_mean_cat_all#16.week_from_opening_7_5_2 = "11" 1.open1_mean_cat_all#17.week_from_opening_7_5_2 = "12" 1.open1_mean_cat_all#18.week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)


graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - No Mask Mandate 3&4 - 210406.gph"
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - No Mask Mandate 3&4 - 210406.jpg", as(jpg) name("Graph") quality(100)



**NE only

**with mask mandate
*running it once and saving the estimates as hybrid
reg cases_per_pop_log i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if h6_facialcoverings34_all == 1 & region == 0, vce(cluster fips)

estimates store hybrid_maskmandate34_ne

*running it again and saving the estimates as traditional
reg cases_per_pop_log i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if h6_facialcoverings34_all == 1 & region == 0, vce(cluster fips)

estimates store trad_maskmandate34_ne

**PLOTTING THE COEFFICIENTS*****
coefplot (hybrid_maskmandate34_ne, keep(1.open1_mean_cat_all#1.week_from_opening_7_5_2 1.open1_mean_cat_all#2.week_from_opening_7_5_2 1.open1_mean_cat_all#3.week_from_opening_7_5_2 1.open1_mean_cat_all#4.week_from_opening_7_5_2 1.open1_mean_cat_all#5.week_from_opening_7_5_2 1.open1_mean_cat_all#6.week_from_opening_7_5_2 1.open1_mean_cat_all#7.week_from_opening_7_5_2 1.open1_mean_cat_all#8.week_from_opening_7_5_2 1.open1_mean_cat_all#9.week_from_opening_7_5_2 1.open1_mean_cat_all#10.week_from_opening_7_5_2 1.open1_mean_cat_all#11.week_from_opening_7_5_2 1.open1_mean_cat_all#12.week_from_opening_7_5_2 1.open1_mean_cat_all#13.week_from_opening_7_5_2 1.open1_mean_cat_all#14.week_from_opening_7_5_2 1.open1_mean_cat_all#15.week_from_opening_7_5_2 1.open1_mean_cat_all#16.week_from_opening_7_5_2 1.open1_mean_cat_all#17.week_from_opening_7_5_2 1.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Hybrid) mlcolor(black))   (trad_maskmandate34_ne, keep(2.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Traditional) mlcolor(black)), yline(0, lcolor(black) lpattern(dash)) vertical rename(2.open1_mean_cat_all#1.week_from_opening_7_5_2 = 1.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 = 1.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 = 1.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 = 1.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 = 1.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 = 1.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 = 1.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 = 1.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 = 1.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 = 1.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 = 1.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 = 1.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 = 1.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 = 1.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 = 1.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 = 1.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 = 1.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2 = 1.open1_mean_cat_all#18.week_from_opening_7_5_2) coeflabels(1.open1_mean_cat_all#1.week_from_opening_7_5_2 = "-4" 1.open1_mean_cat_all#2.week_from_opening_7_5_2 = "-3" 1.open1_mean_cat_all#3.week_from_opening_7_5_2 = "-2" 1.open1_mean_cat_all#4.week_from_opening_7_5_2 = "-1" 1.open1_mean_cat_all#5.week_from_opening_7_5_2 = "0" 1.open1_mean_cat_all#6.week_from_opening_7_5_2 = "1" 1.open1_mean_cat_all#7.week_from_opening_7_5_2 = "2" 1.open1_mean_cat_all#8.week_from_opening_7_5_2 = "3" 1.open1_mean_cat_all#9.week_from_opening_7_5_2 = "4" 1.open1_mean_cat_all#10.week_from_opening_7_5_2 = "5" 1.open1_mean_cat_all#11.week_from_opening_7_5_2  = "6" 1.open1_mean_cat_all#12.week_from_opening_7_5_2 = "7" 1.open1_mean_cat_all#13.week_from_opening_7_5_2 = "8" 1.open1_mean_cat_all#14.week_from_opening_7_5_2 = "9" 1.open1_mean_cat_all#15.week_from_opening_7_5_2 = "10" 1.open1_mean_cat_all#16.week_from_opening_7_5_2 = "11" 1.open1_mean_cat_all#17.week_from_opening_7_5_2 = "12" 1.open1_mean_cat_all#18.week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)


graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Mask Mandate 3&4 - NE - 210406.gph", replace
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Mask Mandate 3&4 - NE - 210406.jpg", as(jpg) name("Graph") quality(100) replace




**without mask mandate
*running it once and saving the estimates as hybrid
reg cases_per_pop_log i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if h6_facialcoverings34_all == 0 & region == 0, vce(cluster fips)

estimates store hybrid_nomaskmandate34_ne

*running it again and saving the estimates as traditional
reg cases_per_pop_log i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if h6_facialcoverings34_all == 0 & region == 0, vce(cluster fips)

estimates store trad_nomaskmandate34_ne

**PLOTTING THE COEFFICIENTS*****
coefplot (hybrid_nomaskmandate34_ne, keep(1.open1_mean_cat_all#1.week_from_opening_7_5_2 1.open1_mean_cat_all#2.week_from_opening_7_5_2 1.open1_mean_cat_all#3.week_from_opening_7_5_2 1.open1_mean_cat_all#4.week_from_opening_7_5_2 1.open1_mean_cat_all#5.week_from_opening_7_5_2 1.open1_mean_cat_all#6.week_from_opening_7_5_2 1.open1_mean_cat_all#7.week_from_opening_7_5_2 1.open1_mean_cat_all#8.week_from_opening_7_5_2 1.open1_mean_cat_all#9.week_from_opening_7_5_2 1.open1_mean_cat_all#10.week_from_opening_7_5_2 1.open1_mean_cat_all#11.week_from_opening_7_5_2 1.open1_mean_cat_all#12.week_from_opening_7_5_2 1.open1_mean_cat_all#13.week_from_opening_7_5_2 1.open1_mean_cat_all#14.week_from_opening_7_5_2 1.open1_mean_cat_all#15.week_from_opening_7_5_2 1.open1_mean_cat_all#16.week_from_opening_7_5_2 1.open1_mean_cat_all#17.week_from_opening_7_5_2 1.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Hybrid) mlcolor(black))   (trad_nomaskmandate34_ne, keep(2.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Traditional) mlcolor(black)), yline(0, lcolor(black) lpattern(dash)) vertical rename(2.open1_mean_cat_all#1.week_from_opening_7_5_2 = 1.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 = 1.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 = 1.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 = 1.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 = 1.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 = 1.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 = 1.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 = 1.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 = 1.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 = 1.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 = 1.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 = 1.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 = 1.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 = 1.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 = 1.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 = 1.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 = 1.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2 = 1.open1_mean_cat_all#18.week_from_opening_7_5_2) coeflabels(1.open1_mean_cat_all#1.week_from_opening_7_5_2 = "-4" 1.open1_mean_cat_all#2.week_from_opening_7_5_2 = "-3" 1.open1_mean_cat_all#3.week_from_opening_7_5_2 = "-2" 1.open1_mean_cat_all#4.week_from_opening_7_5_2 = "-1" 1.open1_mean_cat_all#5.week_from_opening_7_5_2 = "0" 1.open1_mean_cat_all#6.week_from_opening_7_5_2 = "1" 1.open1_mean_cat_all#7.week_from_opening_7_5_2 = "2" 1.open1_mean_cat_all#8.week_from_opening_7_5_2 = "3" 1.open1_mean_cat_all#9.week_from_opening_7_5_2 = "4" 1.open1_mean_cat_all#10.week_from_opening_7_5_2 = "5" 1.open1_mean_cat_all#11.week_from_opening_7_5_2  = "6" 1.open1_mean_cat_all#12.week_from_opening_7_5_2 = "7" 1.open1_mean_cat_all#13.week_from_opening_7_5_2 = "8" 1.open1_mean_cat_all#14.week_from_opening_7_5_2 = "9" 1.open1_mean_cat_all#15.week_from_opening_7_5_2 = "10" 1.open1_mean_cat_all#16.week_from_opening_7_5_2 = "11" 1.open1_mean_cat_all#17.week_from_opening_7_5_2 = "12" 1.open1_mean_cat_all#18.week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)


graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - No Mask Mandate 3&4 - NE - 210406.gph", replace
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - No Mask Mandate 3&4 - NE - 210406.jpg", as(jpg) name("Graph") quality(100) replace







**W only

**with mask mandate
*running it once and saving the estimates as hybrid
reg cases_per_pop_log i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if h6_facialcoverings34_all == 1 & region == 1, vce(cluster fips)

estimates store hybrid_maskmandate34_w

*running it again and saving the estimates as traditional
reg cases_per_pop_log i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if h6_facialcoverings34_all == 1 & region == 1, vce(cluster fips)

estimates store trad_maskmandate34_w

**PLOTTING THE COEFFICIENTS*****
coefplot (hybrid_maskmandate34_w, keep(1.open1_mean_cat_all#1.week_from_opening_7_5_2 1.open1_mean_cat_all#2.week_from_opening_7_5_2 1.open1_mean_cat_all#3.week_from_opening_7_5_2 1.open1_mean_cat_all#4.week_from_opening_7_5_2 1.open1_mean_cat_all#5.week_from_opening_7_5_2 1.open1_mean_cat_all#6.week_from_opening_7_5_2 1.open1_mean_cat_all#7.week_from_opening_7_5_2 1.open1_mean_cat_all#8.week_from_opening_7_5_2 1.open1_mean_cat_all#9.week_from_opening_7_5_2 1.open1_mean_cat_all#10.week_from_opening_7_5_2 1.open1_mean_cat_all#11.week_from_opening_7_5_2 1.open1_mean_cat_all#12.week_from_opening_7_5_2 1.open1_mean_cat_all#13.week_from_opening_7_5_2 1.open1_mean_cat_all#14.week_from_opening_7_5_2 1.open1_mean_cat_all#15.week_from_opening_7_5_2 1.open1_mean_cat_all#16.week_from_opening_7_5_2 1.open1_mean_cat_all#17.week_from_opening_7_5_2 1.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Hybrid) mlcolor(black))   (trad_maskmandate34_w, keep(2.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Traditional) mlcolor(black)), yline(0, lcolor(black) lpattern(dash)) vertical rename(2.open1_mean_cat_all#1.week_from_opening_7_5_2 = 1.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 = 1.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 = 1.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 = 1.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 = 1.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 = 1.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 = 1.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 = 1.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 = 1.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 = 1.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 = 1.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 = 1.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 = 1.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 = 1.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 = 1.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 = 1.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 = 1.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2 = 1.open1_mean_cat_all#18.week_from_opening_7_5_2) coeflabels(1.open1_mean_cat_all#1.week_from_opening_7_5_2 = "-4" 1.open1_mean_cat_all#2.week_from_opening_7_5_2 = "-3" 1.open1_mean_cat_all#3.week_from_opening_7_5_2 = "-2" 1.open1_mean_cat_all#4.week_from_opening_7_5_2 = "-1" 1.open1_mean_cat_all#5.week_from_opening_7_5_2 = "0" 1.open1_mean_cat_all#6.week_from_opening_7_5_2 = "1" 1.open1_mean_cat_all#7.week_from_opening_7_5_2 = "2" 1.open1_mean_cat_all#8.week_from_opening_7_5_2 = "3" 1.open1_mean_cat_all#9.week_from_opening_7_5_2 = "4" 1.open1_mean_cat_all#10.week_from_opening_7_5_2 = "5" 1.open1_mean_cat_all#11.week_from_opening_7_5_2  = "6" 1.open1_mean_cat_all#12.week_from_opening_7_5_2 = "7" 1.open1_mean_cat_all#13.week_from_opening_7_5_2 = "8" 1.open1_mean_cat_all#14.week_from_opening_7_5_2 = "9" 1.open1_mean_cat_all#15.week_from_opening_7_5_2 = "10" 1.open1_mean_cat_all#16.week_from_opening_7_5_2 = "11" 1.open1_mean_cat_all#17.week_from_opening_7_5_2 = "12" 1.open1_mean_cat_all#18.week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)


graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Mask Mandate 3&4 - W - 210406.gph", replace
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Mask Mandate 3&4 - W - 210406.jpg", as(jpg) name("Graph") quality(100) replace




**without mask mandate
*running it once and saving the estimates as hybrid
reg cases_per_pop_log i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if h6_facialcoverings34_all == 0 & region == 1, vce(cluster fips)

estimates store hybrid_nomaskmandate34_w

*running it again and saving the estimates as traditional
reg cases_per_pop_log i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if h6_facialcoverings34_all == 0 & region == 1, vce(cluster fips)

estimates store trad_nomaskmandate34_w

**PLOTTING THE COEFFICIENTS*****
coefplot (hybrid_nomaskmandate34_w, keep(1.open1_mean_cat_all#1.week_from_opening_7_5_2 1.open1_mean_cat_all#2.week_from_opening_7_5_2 1.open1_mean_cat_all#3.week_from_opening_7_5_2 1.open1_mean_cat_all#4.week_from_opening_7_5_2 1.open1_mean_cat_all#5.week_from_opening_7_5_2 1.open1_mean_cat_all#6.week_from_opening_7_5_2 1.open1_mean_cat_all#7.week_from_opening_7_5_2 1.open1_mean_cat_all#8.week_from_opening_7_5_2 1.open1_mean_cat_all#9.week_from_opening_7_5_2 1.open1_mean_cat_all#10.week_from_opening_7_5_2 1.open1_mean_cat_all#11.week_from_opening_7_5_2 1.open1_mean_cat_all#12.week_from_opening_7_5_2 1.open1_mean_cat_all#13.week_from_opening_7_5_2 1.open1_mean_cat_all#14.week_from_opening_7_5_2 1.open1_mean_cat_all#15.week_from_opening_7_5_2 1.open1_mean_cat_all#16.week_from_opening_7_5_2 1.open1_mean_cat_all#17.week_from_opening_7_5_2 1.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Hybrid) mlcolor(black))   (trad_nomaskmandate34_w, keep(2.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Traditional) mlcolor(black)), yline(0, lcolor(black) lpattern(dash)) vertical rename(2.open1_mean_cat_all#1.week_from_opening_7_5_2 = 1.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 = 1.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 = 1.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 = 1.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 = 1.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 = 1.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 = 1.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 = 1.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 = 1.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 = 1.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 = 1.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 = 1.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 = 1.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 = 1.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 = 1.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 = 1.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 = 1.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2 = 1.open1_mean_cat_all#18.week_from_opening_7_5_2) coeflabels(1.open1_mean_cat_all#1.week_from_opening_7_5_2 = "-4" 1.open1_mean_cat_all#2.week_from_opening_7_5_2 = "-3" 1.open1_mean_cat_all#3.week_from_opening_7_5_2 = "-2" 1.open1_mean_cat_all#4.week_from_opening_7_5_2 = "-1" 1.open1_mean_cat_all#5.week_from_opening_7_5_2 = "0" 1.open1_mean_cat_all#6.week_from_opening_7_5_2 = "1" 1.open1_mean_cat_all#7.week_from_opening_7_5_2 = "2" 1.open1_mean_cat_all#8.week_from_opening_7_5_2 = "3" 1.open1_mean_cat_all#9.week_from_opening_7_5_2 = "4" 1.open1_mean_cat_all#10.week_from_opening_7_5_2 = "5" 1.open1_mean_cat_all#11.week_from_opening_7_5_2  = "6" 1.open1_mean_cat_all#12.week_from_opening_7_5_2 = "7" 1.open1_mean_cat_all#13.week_from_opening_7_5_2 = "8" 1.open1_mean_cat_all#14.week_from_opening_7_5_2 = "9" 1.open1_mean_cat_all#15.week_from_opening_7_5_2 = "10" 1.open1_mean_cat_all#16.week_from_opening_7_5_2 = "11" 1.open1_mean_cat_all#17.week_from_opening_7_5_2 = "12" 1.open1_mean_cat_all#18.week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)


graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - No Mask Mandate 3&4 - W - 210406.gph", replace
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - No Mask Mandate 3&4 - W - 210406.jpg", as(jpg) name("Graph") quality(100) replace




**MW only

**with mask mandate
*running it once and saving the estimates as hybrid
reg cases_per_pop_log i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if h6_facialcoverings34_all == 1 & region == 2, vce(cluster fips)

estimates store hybrid_maskmandate34_mw

*running it again and saving the estimates as traditional
reg cases_per_pop_log i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if h6_facialcoverings34_all == 1 & region == 2, vce(cluster fips)

estimates store trad_maskmandate34_mw

**PLOTTING THE COEFFICIENTS*****
coefplot (hybrid_maskmandate34_mw, keep(1.open1_mean_cat_all#1.week_from_opening_7_5_2 1.open1_mean_cat_all#2.week_from_opening_7_5_2 1.open1_mean_cat_all#3.week_from_opening_7_5_2 1.open1_mean_cat_all#4.week_from_opening_7_5_2 1.open1_mean_cat_all#5.week_from_opening_7_5_2 1.open1_mean_cat_all#6.week_from_opening_7_5_2 1.open1_mean_cat_all#7.week_from_opening_7_5_2 1.open1_mean_cat_all#8.week_from_opening_7_5_2 1.open1_mean_cat_all#9.week_from_opening_7_5_2 1.open1_mean_cat_all#10.week_from_opening_7_5_2 1.open1_mean_cat_all#11.week_from_opening_7_5_2 1.open1_mean_cat_all#12.week_from_opening_7_5_2 1.open1_mean_cat_all#13.week_from_opening_7_5_2 1.open1_mean_cat_all#14.week_from_opening_7_5_2 1.open1_mean_cat_all#15.week_from_opening_7_5_2 1.open1_mean_cat_all#16.week_from_opening_7_5_2 1.open1_mean_cat_all#17.week_from_opening_7_5_2 1.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Hybrid) mlcolor(black))   (trad_maskmandate34_mw, keep(2.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Traditional) mlcolor(black)), yline(0, lcolor(black) lpattern(dash)) vertical rename(2.open1_mean_cat_all#1.week_from_opening_7_5_2 = 1.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 = 1.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 = 1.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 = 1.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 = 1.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 = 1.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 = 1.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 = 1.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 = 1.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 = 1.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 = 1.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 = 1.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 = 1.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 = 1.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 = 1.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 = 1.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 = 1.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2 = 1.open1_mean_cat_all#18.week_from_opening_7_5_2) coeflabels(1.open1_mean_cat_all#1.week_from_opening_7_5_2 = "-4" 1.open1_mean_cat_all#2.week_from_opening_7_5_2 = "-3" 1.open1_mean_cat_all#3.week_from_opening_7_5_2 = "-2" 1.open1_mean_cat_all#4.week_from_opening_7_5_2 = "-1" 1.open1_mean_cat_all#5.week_from_opening_7_5_2 = "0" 1.open1_mean_cat_all#6.week_from_opening_7_5_2 = "1" 1.open1_mean_cat_all#7.week_from_opening_7_5_2 = "2" 1.open1_mean_cat_all#8.week_from_opening_7_5_2 = "3" 1.open1_mean_cat_all#9.week_from_opening_7_5_2 = "4" 1.open1_mean_cat_all#10.week_from_opening_7_5_2 = "5" 1.open1_mean_cat_all#11.week_from_opening_7_5_2  = "6" 1.open1_mean_cat_all#12.week_from_opening_7_5_2 = "7" 1.open1_mean_cat_all#13.week_from_opening_7_5_2 = "8" 1.open1_mean_cat_all#14.week_from_opening_7_5_2 = "9" 1.open1_mean_cat_all#15.week_from_opening_7_5_2 = "10" 1.open1_mean_cat_all#16.week_from_opening_7_5_2 = "11" 1.open1_mean_cat_all#17.week_from_opening_7_5_2 = "12" 1.open1_mean_cat_all#18.week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)


graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Mask Mandate 3&4 - MW - 210406.gph", replace
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Mask Mandate 3&4 - MW - 210406.jpg", as(jpg) name("Graph") quality(100) replace




**without mask mandate
*running it once and saving the estimates as hybrid
reg cases_per_pop_log i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if h6_facialcoverings34_all == 0 & region == 2, vce(cluster fips)

estimates store hybrid_nomaskmandate34_mw

*running it again and saving the estimates as traditional
reg cases_per_pop_log i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if h6_facialcoverings34_all == 0 & region == 2, vce(cluster fips)

estimates store trad_nomaskmandate34_mw

**PLOTTING THE COEFFICIENTS*****
coefplot (hybrid_nomaskmandate34_mw, keep(1.open1_mean_cat_all#1.week_from_opening_7_5_2 1.open1_mean_cat_all#2.week_from_opening_7_5_2 1.open1_mean_cat_all#3.week_from_opening_7_5_2 1.open1_mean_cat_all#4.week_from_opening_7_5_2 1.open1_mean_cat_all#5.week_from_opening_7_5_2 1.open1_mean_cat_all#6.week_from_opening_7_5_2 1.open1_mean_cat_all#7.week_from_opening_7_5_2 1.open1_mean_cat_all#8.week_from_opening_7_5_2 1.open1_mean_cat_all#9.week_from_opening_7_5_2 1.open1_mean_cat_all#10.week_from_opening_7_5_2 1.open1_mean_cat_all#11.week_from_opening_7_5_2 1.open1_mean_cat_all#12.week_from_opening_7_5_2 1.open1_mean_cat_all#13.week_from_opening_7_5_2 1.open1_mean_cat_all#14.week_from_opening_7_5_2 1.open1_mean_cat_all#15.week_from_opening_7_5_2 1.open1_mean_cat_all#16.week_from_opening_7_5_2 1.open1_mean_cat_all#17.week_from_opening_7_5_2 1.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Hybrid) mlcolor(black))   (trad_nomaskmandate34_mw, keep(2.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Traditional) mlcolor(black)), yline(0, lcolor(black) lpattern(dash)) vertical rename(2.open1_mean_cat_all#1.week_from_opening_7_5_2 = 1.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 = 1.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 = 1.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 = 1.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 = 1.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 = 1.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 = 1.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 = 1.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 = 1.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 = 1.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 = 1.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 = 1.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 = 1.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 = 1.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 = 1.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 = 1.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 = 1.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2 = 1.open1_mean_cat_all#18.week_from_opening_7_5_2) coeflabels(1.open1_mean_cat_all#1.week_from_opening_7_5_2 = "-4" 1.open1_mean_cat_all#2.week_from_opening_7_5_2 = "-3" 1.open1_mean_cat_all#3.week_from_opening_7_5_2 = "-2" 1.open1_mean_cat_all#4.week_from_opening_7_5_2 = "-1" 1.open1_mean_cat_all#5.week_from_opening_7_5_2 = "0" 1.open1_mean_cat_all#6.week_from_opening_7_5_2 = "1" 1.open1_mean_cat_all#7.week_from_opening_7_5_2 = "2" 1.open1_mean_cat_all#8.week_from_opening_7_5_2 = "3" 1.open1_mean_cat_all#9.week_from_opening_7_5_2 = "4" 1.open1_mean_cat_all#10.week_from_opening_7_5_2 = "5" 1.open1_mean_cat_all#11.week_from_opening_7_5_2  = "6" 1.open1_mean_cat_all#12.week_from_opening_7_5_2 = "7" 1.open1_mean_cat_all#13.week_from_opening_7_5_2 = "8" 1.open1_mean_cat_all#14.week_from_opening_7_5_2 = "9" 1.open1_mean_cat_all#15.week_from_opening_7_5_2 = "10" 1.open1_mean_cat_all#16.week_from_opening_7_5_2 = "11" 1.open1_mean_cat_all#17.week_from_opening_7_5_2 = "12" 1.open1_mean_cat_all#18.week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)


graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - No Mask Mandate 3&4 - MW - 210406.gph", replace
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - No Mask Mandate 3&4 - MW - 210406.jpg", as(jpg) name("Graph") quality(100) replace






**S only

**with mask mandate
*running it once and saving the estimates as hybrid
reg cases_per_pop_log i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if h6_facialcoverings34_all == 1 & region == 3, vce(cluster fips)

estimates store hybrid_maskmandate34_s

*running it again and saving the estimates as traditional
reg cases_per_pop_log i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if h6_facialcoverings34_all == 1 & region == 3, vce(cluster fips)

estimates store trad_maskmandate34_s

**PLOTTING THE COEFFICIENTS*****
coefplot (hybrid_maskmandate34_s, keep(1.open1_mean_cat_all#1.week_from_opening_7_5_2 1.open1_mean_cat_all#2.week_from_opening_7_5_2 1.open1_mean_cat_all#3.week_from_opening_7_5_2 1.open1_mean_cat_all#4.week_from_opening_7_5_2 1.open1_mean_cat_all#5.week_from_opening_7_5_2 1.open1_mean_cat_all#6.week_from_opening_7_5_2 1.open1_mean_cat_all#7.week_from_opening_7_5_2 1.open1_mean_cat_all#8.week_from_opening_7_5_2 1.open1_mean_cat_all#9.week_from_opening_7_5_2 1.open1_mean_cat_all#10.week_from_opening_7_5_2 1.open1_mean_cat_all#11.week_from_opening_7_5_2 1.open1_mean_cat_all#12.week_from_opening_7_5_2 1.open1_mean_cat_all#13.week_from_opening_7_5_2 1.open1_mean_cat_all#14.week_from_opening_7_5_2 1.open1_mean_cat_all#15.week_from_opening_7_5_2 1.open1_mean_cat_all#16.week_from_opening_7_5_2 1.open1_mean_cat_all#17.week_from_opening_7_5_2 1.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Hybrid) mlcolor(black))   (trad_maskmandate34_s, keep(2.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Traditional) mlcolor(black)), yline(0, lcolor(black) lpattern(dash)) vertical rename(2.open1_mean_cat_all#1.week_from_opening_7_5_2 = 1.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 = 1.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 = 1.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 = 1.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 = 1.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 = 1.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 = 1.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 = 1.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 = 1.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 = 1.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 = 1.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 = 1.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 = 1.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 = 1.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 = 1.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 = 1.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 = 1.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2 = 1.open1_mean_cat_all#18.week_from_opening_7_5_2) coeflabels(1.open1_mean_cat_all#1.week_from_opening_7_5_2 = "-4" 1.open1_mean_cat_all#2.week_from_opening_7_5_2 = "-3" 1.open1_mean_cat_all#3.week_from_opening_7_5_2 = "-2" 1.open1_mean_cat_all#4.week_from_opening_7_5_2 = "-1" 1.open1_mean_cat_all#5.week_from_opening_7_5_2 = "0" 1.open1_mean_cat_all#6.week_from_opening_7_5_2 = "1" 1.open1_mean_cat_all#7.week_from_opening_7_5_2 = "2" 1.open1_mean_cat_all#8.week_from_opening_7_5_2 = "3" 1.open1_mean_cat_all#9.week_from_opening_7_5_2 = "4" 1.open1_mean_cat_all#10.week_from_opening_7_5_2 = "5" 1.open1_mean_cat_all#11.week_from_opening_7_5_2  = "6" 1.open1_mean_cat_all#12.week_from_opening_7_5_2 = "7" 1.open1_mean_cat_all#13.week_from_opening_7_5_2 = "8" 1.open1_mean_cat_all#14.week_from_opening_7_5_2 = "9" 1.open1_mean_cat_all#15.week_from_opening_7_5_2 = "10" 1.open1_mean_cat_all#16.week_from_opening_7_5_2 = "11" 1.open1_mean_cat_all#17.week_from_opening_7_5_2 = "12" 1.open1_mean_cat_all#18.week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)


graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Mask Mandate 3&4 - S - 210406.gph", replace
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Mask Mandate 3&4 - S - 210406.jpg", as(jpg) name("Graph") quality(100) replace




**without mask mandate
*running it once and saving the estimates as hybrid
reg cases_per_pop_log i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if h6_facialcoverings34_all == 0 & region == 3, vce(cluster fips)

estimates store hybrid_nomaskmandate34_s

*running it again and saving the estimates as traditional
reg cases_per_pop_log i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if h6_facialcoverings34_all == 0 & region == 3, vce(cluster fips)

estimates store trad_nomaskmandate34_s

**PLOTTING THE COEFFICIENTS*****
coefplot (hybrid_nomaskmandate34_s, keep(1.open1_mean_cat_all#1.week_from_opening_7_5_2 1.open1_mean_cat_all#2.week_from_opening_7_5_2 1.open1_mean_cat_all#3.week_from_opening_7_5_2 1.open1_mean_cat_all#4.week_from_opening_7_5_2 1.open1_mean_cat_all#5.week_from_opening_7_5_2 1.open1_mean_cat_all#6.week_from_opening_7_5_2 1.open1_mean_cat_all#7.week_from_opening_7_5_2 1.open1_mean_cat_all#8.week_from_opening_7_5_2 1.open1_mean_cat_all#9.week_from_opening_7_5_2 1.open1_mean_cat_all#10.week_from_opening_7_5_2 1.open1_mean_cat_all#11.week_from_opening_7_5_2 1.open1_mean_cat_all#12.week_from_opening_7_5_2 1.open1_mean_cat_all#13.week_from_opening_7_5_2 1.open1_mean_cat_all#14.week_from_opening_7_5_2 1.open1_mean_cat_all#15.week_from_opening_7_5_2 1.open1_mean_cat_all#16.week_from_opening_7_5_2 1.open1_mean_cat_all#17.week_from_opening_7_5_2 1.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Hybrid) mlcolor(black))   (trad_nomaskmandate34_s, keep(2.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Traditional) mlcolor(black)), yline(0, lcolor(black) lpattern(dash)) vertical rename(2.open1_mean_cat_all#1.week_from_opening_7_5_2 = 1.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 = 1.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 = 1.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 = 1.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 = 1.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 = 1.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 = 1.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 = 1.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 = 1.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 = 1.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 = 1.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 = 1.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 = 1.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 = 1.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 = 1.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 = 1.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 = 1.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2 = 1.open1_mean_cat_all#18.week_from_opening_7_5_2) coeflabels(1.open1_mean_cat_all#1.week_from_opening_7_5_2 = "-4" 1.open1_mean_cat_all#2.week_from_opening_7_5_2 = "-3" 1.open1_mean_cat_all#3.week_from_opening_7_5_2 = "-2" 1.open1_mean_cat_all#4.week_from_opening_7_5_2 = "-1" 1.open1_mean_cat_all#5.week_from_opening_7_5_2 = "0" 1.open1_mean_cat_all#6.week_from_opening_7_5_2 = "1" 1.open1_mean_cat_all#7.week_from_opening_7_5_2 = "2" 1.open1_mean_cat_all#8.week_from_opening_7_5_2 = "3" 1.open1_mean_cat_all#9.week_from_opening_7_5_2 = "4" 1.open1_mean_cat_all#10.week_from_opening_7_5_2 = "5" 1.open1_mean_cat_all#11.week_from_opening_7_5_2  = "6" 1.open1_mean_cat_all#12.week_from_opening_7_5_2 = "7" 1.open1_mean_cat_all#13.week_from_opening_7_5_2 = "8" 1.open1_mean_cat_all#14.week_from_opening_7_5_2 = "9" 1.open1_mean_cat_all#15.week_from_opening_7_5_2 = "10" 1.open1_mean_cat_all#16.week_from_opening_7_5_2 = "11" 1.open1_mean_cat_all#17.week_from_opening_7_5_2 = "12" 1.open1_mean_cat_all#18.week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)


graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - No Mask Mandate 3&4 - S - 210406.gph", replace
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - No Mask Mandate 3&4 - S - 210406.jpg", as(jpg) name("Graph") quality(100) replace









***MASK MANDATE 2,3,4
**with mask mandate
*running it once and saving the estimates as hybrid
reg cases_per_pop_log i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if h6_facialcoverings234_all == 1, vce(cluster fips)

estimates store hybrid_maskmandate234

*running it again and saving the estimates as traditional
reg cases_per_pop_log i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if h6_facialcoverings234_all == 1, vce(cluster fips)

estimates store traditional_maskmandate234

**PLOTTING THE COEFFICIENTS*****
coefplot (hybrid_maskmandate234, keep(1.open1_mean_cat_all#1.week_from_opening_7_5_2 1.open1_mean_cat_all#2.week_from_opening_7_5_2 1.open1_mean_cat_all#3.week_from_opening_7_5_2 1.open1_mean_cat_all#4.week_from_opening_7_5_2 1.open1_mean_cat_all#5.week_from_opening_7_5_2 1.open1_mean_cat_all#6.week_from_opening_7_5_2 1.open1_mean_cat_all#7.week_from_opening_7_5_2 1.open1_mean_cat_all#8.week_from_opening_7_5_2 1.open1_mean_cat_all#9.week_from_opening_7_5_2 1.open1_mean_cat_all#10.week_from_opening_7_5_2 1.open1_mean_cat_all#11.week_from_opening_7_5_2 1.open1_mean_cat_all#12.week_from_opening_7_5_2 1.open1_mean_cat_all#13.week_from_opening_7_5_2 1.open1_mean_cat_all#14.week_from_opening_7_5_2 1.open1_mean_cat_all#15.week_from_opening_7_5_2 1.open1_mean_cat_all#16.week_from_opening_7_5_2 1.open1_mean_cat_all#17.week_from_opening_7_5_2 1.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Hybrid) mlcolor(black))   (traditional_maskmandate234, keep(2.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Traditional) mlcolor(black)), yline(0, lcolor(black) lpattern(dash)) vertical rename(2.open1_mean_cat_all#1.week_from_opening_7_5_2 = 1.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 = 1.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 = 1.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 = 1.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 = 1.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 = 1.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 = 1.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 = 1.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 = 1.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 = 1.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 = 1.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 = 1.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 = 1.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 = 1.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 = 1.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 = 1.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 = 1.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2 = 1.open1_mean_cat_all#18.week_from_opening_7_5_2) coeflabels(1.open1_mean_cat_all#1.week_from_opening_7_5_2 = "-4" 1.open1_mean_cat_all#2.week_from_opening_7_5_2 = "-3" 1.open1_mean_cat_all#3.week_from_opening_7_5_2 = "-2" 1.open1_mean_cat_all#4.week_from_opening_7_5_2 = "-1" 1.open1_mean_cat_all#5.week_from_opening_7_5_2 = "0" 1.open1_mean_cat_all#6.week_from_opening_7_5_2 = "1" 1.open1_mean_cat_all#7.week_from_opening_7_5_2 = "2" 1.open1_mean_cat_all#8.week_from_opening_7_5_2 = "3" 1.open1_mean_cat_all#9.week_from_opening_7_5_2 = "4" 1.open1_mean_cat_all#10.week_from_opening_7_5_2 = "5" 1.open1_mean_cat_all#11.week_from_opening_7_5_2  = "6" 1.open1_mean_cat_all#12.week_from_opening_7_5_2 = "7" 1.open1_mean_cat_all#13.week_from_opening_7_5_2 = "8" 1.open1_mean_cat_all#14.week_from_opening_7_5_2 = "9" 1.open1_mean_cat_all#15.week_from_opening_7_5_2 = "10" 1.open1_mean_cat_all#16.week_from_opening_7_5_2 = "11" 1.open1_mean_cat_all#17.week_from_opening_7_5_2 = "12" 1.open1_mean_cat_all#18.week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)


graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Mask Mandate 234 - 210406.gph"
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Mask Mandate 234 - 210406.jpg", as(jpg) name("Graph") quality(100)




**without mask mandate
*running it once and saving the estimates as hybrid
reg cases_per_pop_log i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if h6_facialcoverings234_all == 0, vce(cluster fips)

estimates store hybrid_nomaskmandate234

*running it again and saving the estimates as traditional
reg cases_per_pop_log i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if h6_facialcoverings234_all == 0, vce(cluster fips)

estimates store trad_nomaskmandate234

**PLOTTING THE COEFFICIENTS*****
coefplot (hybrid_nomaskmandate234, keep(1.open1_mean_cat_all#1.week_from_opening_7_5_2 1.open1_mean_cat_all#2.week_from_opening_7_5_2 1.open1_mean_cat_all#3.week_from_opening_7_5_2 1.open1_mean_cat_all#4.week_from_opening_7_5_2 1.open1_mean_cat_all#5.week_from_opening_7_5_2 1.open1_mean_cat_all#6.week_from_opening_7_5_2 1.open1_mean_cat_all#7.week_from_opening_7_5_2 1.open1_mean_cat_all#8.week_from_opening_7_5_2 1.open1_mean_cat_all#9.week_from_opening_7_5_2 1.open1_mean_cat_all#10.week_from_opening_7_5_2 1.open1_mean_cat_all#11.week_from_opening_7_5_2 1.open1_mean_cat_all#12.week_from_opening_7_5_2 1.open1_mean_cat_all#13.week_from_opening_7_5_2 1.open1_mean_cat_all#14.week_from_opening_7_5_2 1.open1_mean_cat_all#15.week_from_opening_7_5_2 1.open1_mean_cat_all#16.week_from_opening_7_5_2 1.open1_mean_cat_all#17.week_from_opening_7_5_2 1.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Hybrid) mlcolor(black))   (trad_nomaskmandate234, keep(2.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Traditional) mlcolor(black)), yline(0, lcolor(black) lpattern(dash)) vertical rename(2.open1_mean_cat_all#1.week_from_opening_7_5_2 = 1.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 = 1.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 = 1.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 = 1.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 = 1.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 = 1.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 = 1.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 = 1.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 = 1.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 = 1.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 = 1.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 = 1.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 = 1.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 = 1.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 = 1.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 = 1.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 = 1.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2 = 1.open1_mean_cat_all#18.week_from_opening_7_5_2) coeflabels(1.open1_mean_cat_all#1.week_from_opening_7_5_2 = "-4" 1.open1_mean_cat_all#2.week_from_opening_7_5_2 = "-3" 1.open1_mean_cat_all#3.week_from_opening_7_5_2 = "-2" 1.open1_mean_cat_all#4.week_from_opening_7_5_2 = "-1" 1.open1_mean_cat_all#5.week_from_opening_7_5_2 = "0" 1.open1_mean_cat_all#6.week_from_opening_7_5_2 = "1" 1.open1_mean_cat_all#7.week_from_opening_7_5_2 = "2" 1.open1_mean_cat_all#8.week_from_opening_7_5_2 = "3" 1.open1_mean_cat_all#9.week_from_opening_7_5_2 = "4" 1.open1_mean_cat_all#10.week_from_opening_7_5_2 = "5" 1.open1_mean_cat_all#11.week_from_opening_7_5_2  = "6" 1.open1_mean_cat_all#12.week_from_opening_7_5_2 = "7" 1.open1_mean_cat_all#13.week_from_opening_7_5_2 = "8" 1.open1_mean_cat_all#14.week_from_opening_7_5_2 = "9" 1.open1_mean_cat_all#15.week_from_opening_7_5_2 = "10" 1.open1_mean_cat_all#16.week_from_opening_7_5_2 = "11" 1.open1_mean_cat_all#17.week_from_opening_7_5_2 = "12" 1.open1_mean_cat_all#18.week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)


graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - No Mask Mandate 234 - 210406.gph", replace
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - No Mask Mandate 234 - 210406.jpg", as(jpg) name("Graph") quality(100) replace



**MW only

**with mask mandate
*running it once and saving the estimates as hybrid
reg cases_per_pop_log i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if h6_facialcoverings234_all == 1 & region == 2, vce(cluster fips)

estimates store hybrid_maskmandate234_mw

*running it again and saving the estimates as traditional
reg cases_per_pop_log i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if h6_facialcoverings234_all == 1 & region == 2, vce(cluster fips)

estimates store trad_maskmandate234_mw

**PLOTTING THE COEFFICIENTS*****
coefplot (hybrid_maskmandate234_mw, keep(1.open1_mean_cat_all#1.week_from_opening_7_5_2 1.open1_mean_cat_all#2.week_from_opening_7_5_2 1.open1_mean_cat_all#3.week_from_opening_7_5_2 1.open1_mean_cat_all#4.week_from_opening_7_5_2 1.open1_mean_cat_all#5.week_from_opening_7_5_2 1.open1_mean_cat_all#6.week_from_opening_7_5_2 1.open1_mean_cat_all#7.week_from_opening_7_5_2 1.open1_mean_cat_all#8.week_from_opening_7_5_2 1.open1_mean_cat_all#9.week_from_opening_7_5_2 1.open1_mean_cat_all#10.week_from_opening_7_5_2 1.open1_mean_cat_all#11.week_from_opening_7_5_2 1.open1_mean_cat_all#12.week_from_opening_7_5_2 1.open1_mean_cat_all#13.week_from_opening_7_5_2 1.open1_mean_cat_all#14.week_from_opening_7_5_2 1.open1_mean_cat_all#15.week_from_opening_7_5_2 1.open1_mean_cat_all#16.week_from_opening_7_5_2 1.open1_mean_cat_all#17.week_from_opening_7_5_2 1.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Hybrid) mlcolor(black))   (trad_maskmandate234_mw, keep(2.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Traditional) mlcolor(black)), yline(0, lcolor(black) lpattern(dash)) vertical rename(2.open1_mean_cat_all#1.week_from_opening_7_5_2 = 1.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 = 1.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 = 1.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 = 1.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 = 1.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 = 1.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 = 1.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 = 1.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 = 1.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 = 1.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 = 1.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 = 1.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 = 1.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 = 1.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 = 1.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 = 1.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 = 1.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2 = 1.open1_mean_cat_all#18.week_from_opening_7_5_2) coeflabels(1.open1_mean_cat_all#1.week_from_opening_7_5_2 = "-4" 1.open1_mean_cat_all#2.week_from_opening_7_5_2 = "-3" 1.open1_mean_cat_all#3.week_from_opening_7_5_2 = "-2" 1.open1_mean_cat_all#4.week_from_opening_7_5_2 = "-1" 1.open1_mean_cat_all#5.week_from_opening_7_5_2 = "0" 1.open1_mean_cat_all#6.week_from_opening_7_5_2 = "1" 1.open1_mean_cat_all#7.week_from_opening_7_5_2 = "2" 1.open1_mean_cat_all#8.week_from_opening_7_5_2 = "3" 1.open1_mean_cat_all#9.week_from_opening_7_5_2 = "4" 1.open1_mean_cat_all#10.week_from_opening_7_5_2 = "5" 1.open1_mean_cat_all#11.week_from_opening_7_5_2  = "6" 1.open1_mean_cat_all#12.week_from_opening_7_5_2 = "7" 1.open1_mean_cat_all#13.week_from_opening_7_5_2 = "8" 1.open1_mean_cat_all#14.week_from_opening_7_5_2 = "9" 1.open1_mean_cat_all#15.week_from_opening_7_5_2 = "10" 1.open1_mean_cat_all#16.week_from_opening_7_5_2 = "11" 1.open1_mean_cat_all#17.week_from_opening_7_5_2 = "12" 1.open1_mean_cat_all#18.week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)


graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Mask Mandate 234 - MW - 210406.gph", replace
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Mask Mandate 234 - MW - 210406.jpg", as(jpg) name("Graph") quality(100) replace




**without mask mandate
*running it once and saving the estimates as hybrid
reg cases_per_pop_log i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if h6_facialcoverings234_all == 0 & region == 2, vce(cluster fips)

estimates store hybrid_nomaskmandate234_mw

*running it again and saving the estimates as traditional
reg cases_per_pop_log i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if h6_facialcoverings234_all == 0 & region == 2, vce(cluster fips)

estimates store trad_nomaskmandate234_mw

**PLOTTING THE COEFFICIENTS*****
coefplot (hybrid_nomaskmandate234_mw, keep(1.open1_mean_cat_all#1.week_from_opening_7_5_2 1.open1_mean_cat_all#2.week_from_opening_7_5_2 1.open1_mean_cat_all#3.week_from_opening_7_5_2 1.open1_mean_cat_all#4.week_from_opening_7_5_2 1.open1_mean_cat_all#5.week_from_opening_7_5_2 1.open1_mean_cat_all#6.week_from_opening_7_5_2 1.open1_mean_cat_all#7.week_from_opening_7_5_2 1.open1_mean_cat_all#8.week_from_opening_7_5_2 1.open1_mean_cat_all#9.week_from_opening_7_5_2 1.open1_mean_cat_all#10.week_from_opening_7_5_2 1.open1_mean_cat_all#11.week_from_opening_7_5_2 1.open1_mean_cat_all#12.week_from_opening_7_5_2 1.open1_mean_cat_all#13.week_from_opening_7_5_2 1.open1_mean_cat_all#14.week_from_opening_7_5_2 1.open1_mean_cat_all#15.week_from_opening_7_5_2 1.open1_mean_cat_all#16.week_from_opening_7_5_2 1.open1_mean_cat_all#17.week_from_opening_7_5_2 1.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Hybrid) mlcolor(black))   (trad_nomaskmandate234_mw, keep(2.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Traditional) mlcolor(black)), yline(0, lcolor(black) lpattern(dash)) vertical rename(2.open1_mean_cat_all#1.week_from_opening_7_5_2 = 1.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 = 1.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 = 1.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 = 1.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 = 1.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 = 1.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 = 1.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 = 1.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 = 1.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 = 1.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 = 1.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 = 1.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 = 1.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 = 1.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 = 1.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 = 1.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 = 1.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2 = 1.open1_mean_cat_all#18.week_from_opening_7_5_2) coeflabels(1.open1_mean_cat_all#1.week_from_opening_7_5_2 = "-4" 1.open1_mean_cat_all#2.week_from_opening_7_5_2 = "-3" 1.open1_mean_cat_all#3.week_from_opening_7_5_2 = "-2" 1.open1_mean_cat_all#4.week_from_opening_7_5_2 = "-1" 1.open1_mean_cat_all#5.week_from_opening_7_5_2 = "0" 1.open1_mean_cat_all#6.week_from_opening_7_5_2 = "1" 1.open1_mean_cat_all#7.week_from_opening_7_5_2 = "2" 1.open1_mean_cat_all#8.week_from_opening_7_5_2 = "3" 1.open1_mean_cat_all#9.week_from_opening_7_5_2 = "4" 1.open1_mean_cat_all#10.week_from_opening_7_5_2 = "5" 1.open1_mean_cat_all#11.week_from_opening_7_5_2  = "6" 1.open1_mean_cat_all#12.week_from_opening_7_5_2 = "7" 1.open1_mean_cat_all#13.week_from_opening_7_5_2 = "8" 1.open1_mean_cat_all#14.week_from_opening_7_5_2 = "9" 1.open1_mean_cat_all#15.week_from_opening_7_5_2 = "10" 1.open1_mean_cat_all#16.week_from_opening_7_5_2 = "11" 1.open1_mean_cat_all#17.week_from_opening_7_5_2 = "12" 1.open1_mean_cat_all#18.week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)


graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - No Mask Mandate 234 - MW - 210406.gph", replace
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - No Mask Mandate 234 - MW - 210406.jpg", as(jpg) name("Graph") quality(100) replace






**S only

**with mask mandate
*running it once and saving the estimates as hybrid
reg cases_per_pop_log i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if h6_facialcoverings234_all == 1 & region == 3, vce(cluster fips)

estimates store hybrid_maskmandate234_s

*running it again and saving the estimates as traditional
reg cases_per_pop_log i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if h6_facialcoverings234_all == 1 & region == 3, vce(cluster fips)

estimates store trad_maskmandate234_s

**PLOTTING THE COEFFICIENTS*****
coefplot (hybrid_maskmandate234_s, keep(1.open1_mean_cat_all#1.week_from_opening_7_5_2 1.open1_mean_cat_all#2.week_from_opening_7_5_2 1.open1_mean_cat_all#3.week_from_opening_7_5_2 1.open1_mean_cat_all#4.week_from_opening_7_5_2 1.open1_mean_cat_all#5.week_from_opening_7_5_2 1.open1_mean_cat_all#6.week_from_opening_7_5_2 1.open1_mean_cat_all#7.week_from_opening_7_5_2 1.open1_mean_cat_all#8.week_from_opening_7_5_2 1.open1_mean_cat_all#9.week_from_opening_7_5_2 1.open1_mean_cat_all#10.week_from_opening_7_5_2 1.open1_mean_cat_all#11.week_from_opening_7_5_2 1.open1_mean_cat_all#12.week_from_opening_7_5_2 1.open1_mean_cat_all#13.week_from_opening_7_5_2 1.open1_mean_cat_all#14.week_from_opening_7_5_2 1.open1_mean_cat_all#15.week_from_opening_7_5_2 1.open1_mean_cat_all#16.week_from_opening_7_5_2 1.open1_mean_cat_all#17.week_from_opening_7_5_2 1.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Hybrid) mlcolor(black))   (trad_maskmandate234_s, keep(2.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Traditional) mlcolor(black)), yline(0, lcolor(black) lpattern(dash)) vertical rename(2.open1_mean_cat_all#1.week_from_opening_7_5_2 = 1.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 = 1.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 = 1.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 = 1.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 = 1.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 = 1.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 = 1.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 = 1.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 = 1.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 = 1.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 = 1.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 = 1.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 = 1.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 = 1.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 = 1.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 = 1.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 = 1.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2 = 1.open1_mean_cat_all#18.week_from_opening_7_5_2) coeflabels(1.open1_mean_cat_all#1.week_from_opening_7_5_2 = "-4" 1.open1_mean_cat_all#2.week_from_opening_7_5_2 = "-3" 1.open1_mean_cat_all#3.week_from_opening_7_5_2 = "-2" 1.open1_mean_cat_all#4.week_from_opening_7_5_2 = "-1" 1.open1_mean_cat_all#5.week_from_opening_7_5_2 = "0" 1.open1_mean_cat_all#6.week_from_opening_7_5_2 = "1" 1.open1_mean_cat_all#7.week_from_opening_7_5_2 = "2" 1.open1_mean_cat_all#8.week_from_opening_7_5_2 = "3" 1.open1_mean_cat_all#9.week_from_opening_7_5_2 = "4" 1.open1_mean_cat_all#10.week_from_opening_7_5_2 = "5" 1.open1_mean_cat_all#11.week_from_opening_7_5_2  = "6" 1.open1_mean_cat_all#12.week_from_opening_7_5_2 = "7" 1.open1_mean_cat_all#13.week_from_opening_7_5_2 = "8" 1.open1_mean_cat_all#14.week_from_opening_7_5_2 = "9" 1.open1_mean_cat_all#15.week_from_opening_7_5_2 = "10" 1.open1_mean_cat_all#16.week_from_opening_7_5_2 = "11" 1.open1_mean_cat_all#17.week_from_opening_7_5_2 = "12" 1.open1_mean_cat_all#18.week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)


graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Mask Mandate 234 - S - 210406.gph", replace
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Mask Mandate 234 - S - 210406.jpg", as(jpg) name("Graph") quality(100) replace




**without mask mandate
*running it once and saving the estimates as hybrid
reg cases_per_pop_log i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if h6_facialcoverings234_all == 0 & region == 3, vce(cluster fips)

estimates store hybrid_nomaskmandate234_s

*running it again and saving the estimates as traditional
reg cases_per_pop_log i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if h6_facialcoverings234_all == 0 & region == 3, vce(cluster fips)

estimates store trad_nomaskmandate234_s

**PLOTTING THE COEFFICIENTS*****
coefplot (hybrid_nomaskmandate234_s, keep(1.open1_mean_cat_all#1.week_from_opening_7_5_2 1.open1_mean_cat_all#2.week_from_opening_7_5_2 1.open1_mean_cat_all#3.week_from_opening_7_5_2 1.open1_mean_cat_all#4.week_from_opening_7_5_2 1.open1_mean_cat_all#5.week_from_opening_7_5_2 1.open1_mean_cat_all#6.week_from_opening_7_5_2 1.open1_mean_cat_all#7.week_from_opening_7_5_2 1.open1_mean_cat_all#8.week_from_opening_7_5_2 1.open1_mean_cat_all#9.week_from_opening_7_5_2 1.open1_mean_cat_all#10.week_from_opening_7_5_2 1.open1_mean_cat_all#11.week_from_opening_7_5_2 1.open1_mean_cat_all#12.week_from_opening_7_5_2 1.open1_mean_cat_all#13.week_from_opening_7_5_2 1.open1_mean_cat_all#14.week_from_opening_7_5_2 1.open1_mean_cat_all#15.week_from_opening_7_5_2 1.open1_mean_cat_all#16.week_from_opening_7_5_2 1.open1_mean_cat_all#17.week_from_opening_7_5_2 1.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Hybrid) mlcolor(black))   (trad_nomaskmandate234_s, keep(2.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Traditional) mlcolor(black)), yline(0, lcolor(black) lpattern(dash)) vertical rename(2.open1_mean_cat_all#1.week_from_opening_7_5_2 = 1.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 = 1.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 = 1.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 = 1.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 = 1.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 = 1.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 = 1.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 = 1.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 = 1.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 = 1.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 = 1.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 = 1.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 = 1.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 = 1.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 = 1.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 = 1.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 = 1.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2 = 1.open1_mean_cat_all#18.week_from_opening_7_5_2) coeflabels(1.open1_mean_cat_all#1.week_from_opening_7_5_2 = "-4" 1.open1_mean_cat_all#2.week_from_opening_7_5_2 = "-3" 1.open1_mean_cat_all#3.week_from_opening_7_5_2 = "-2" 1.open1_mean_cat_all#4.week_from_opening_7_5_2 = "-1" 1.open1_mean_cat_all#5.week_from_opening_7_5_2 = "0" 1.open1_mean_cat_all#6.week_from_opening_7_5_2 = "1" 1.open1_mean_cat_all#7.week_from_opening_7_5_2 = "2" 1.open1_mean_cat_all#8.week_from_opening_7_5_2 = "3" 1.open1_mean_cat_all#9.week_from_opening_7_5_2 = "4" 1.open1_mean_cat_all#10.week_from_opening_7_5_2 = "5" 1.open1_mean_cat_all#11.week_from_opening_7_5_2  = "6" 1.open1_mean_cat_all#12.week_from_opening_7_5_2 = "7" 1.open1_mean_cat_all#13.week_from_opening_7_5_2 = "8" 1.open1_mean_cat_all#14.week_from_opening_7_5_2 = "9" 1.open1_mean_cat_all#15.week_from_opening_7_5_2 = "10" 1.open1_mean_cat_all#16.week_from_opening_7_5_2 = "11" 1.open1_mean_cat_all#17.week_from_opening_7_5_2 = "12" 1.open1_mean_cat_all#18.week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)


graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - No Mask Mandate 234 - S - 210406.gph", replace
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - No Mask Mandate 234 - S - 210406.jpg", as(jpg) name("Graph") quality(100) replace








***WRIGHT MASK MANDATE***
**with mask mandate
*running it once and saving the estimates as hybrid
reg cases_per_pop_log i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if mask_mandate_wright_opening_all == 1, vce(cluster fips)

estimates store hybrid_maskmandatew

*running it again and saving the estimates as traditional
reg cases_per_pop_log i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if mask_mandate_wright_opening_all == 1, vce(cluster fips)

estimates store traditional_maskmandatew

**PLOTTING THE COEFFICIENTS*****
coefplot (hybrid_maskmandatew, keep(1.open1_mean_cat_all#1.week_from_opening_7_5_2 1.open1_mean_cat_all#2.week_from_opening_7_5_2 1.open1_mean_cat_all#3.week_from_opening_7_5_2 1.open1_mean_cat_all#4.week_from_opening_7_5_2 1.open1_mean_cat_all#5.week_from_opening_7_5_2 1.open1_mean_cat_all#6.week_from_opening_7_5_2 1.open1_mean_cat_all#7.week_from_opening_7_5_2 1.open1_mean_cat_all#8.week_from_opening_7_5_2 1.open1_mean_cat_all#9.week_from_opening_7_5_2 1.open1_mean_cat_all#10.week_from_opening_7_5_2 1.open1_mean_cat_all#11.week_from_opening_7_5_2 1.open1_mean_cat_all#12.week_from_opening_7_5_2 1.open1_mean_cat_all#13.week_from_opening_7_5_2 1.open1_mean_cat_all#14.week_from_opening_7_5_2 1.open1_mean_cat_all#15.week_from_opening_7_5_2 1.open1_mean_cat_all#16.week_from_opening_7_5_2 1.open1_mean_cat_all#17.week_from_opening_7_5_2 1.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Hybrid) mlcolor(black))   (traditional_maskmandatew, keep(2.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Traditional) mlcolor(black)), yline(0, lcolor(black) lpattern(dash)) vertical rename(2.open1_mean_cat_all#1.week_from_opening_7_5_2 = 1.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 = 1.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 = 1.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 = 1.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 = 1.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 = 1.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 = 1.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 = 1.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 = 1.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 = 1.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 = 1.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 = 1.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 = 1.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 = 1.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 = 1.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 = 1.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 = 1.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2 = 1.open1_mean_cat_all#18.week_from_opening_7_5_2) coeflabels(1.open1_mean_cat_all#1.week_from_opening_7_5_2 = "-4" 1.open1_mean_cat_all#2.week_from_opening_7_5_2 = "-3" 1.open1_mean_cat_all#3.week_from_opening_7_5_2 = "-2" 1.open1_mean_cat_all#4.week_from_opening_7_5_2 = "-1" 1.open1_mean_cat_all#5.week_from_opening_7_5_2 = "0" 1.open1_mean_cat_all#6.week_from_opening_7_5_2 = "1" 1.open1_mean_cat_all#7.week_from_opening_7_5_2 = "2" 1.open1_mean_cat_all#8.week_from_opening_7_5_2 = "3" 1.open1_mean_cat_all#9.week_from_opening_7_5_2 = "4" 1.open1_mean_cat_all#10.week_from_opening_7_5_2 = "5" 1.open1_mean_cat_all#11.week_from_opening_7_5_2  = "6" 1.open1_mean_cat_all#12.week_from_opening_7_5_2 = "7" 1.open1_mean_cat_all#13.week_from_opening_7_5_2 = "8" 1.open1_mean_cat_all#14.week_from_opening_7_5_2 = "9" 1.open1_mean_cat_all#15.week_from_opening_7_5_2 = "10" 1.open1_mean_cat_all#16.week_from_opening_7_5_2 = "11" 1.open1_mean_cat_all#17.week_from_opening_7_5_2 = "12" 1.open1_mean_cat_all#18.week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)


graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Mask Mandate Wright - 210406.gph"
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Mask Mandate Wright - 210406.jpg", as(jpg) name("Graph") quality(100)




**without mask mandate
*running it once and saving the estimates as hybrid
reg cases_per_pop_log i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if mask_mandate_wright_opening_all == 0, vce(cluster fips)

estimates store hybrid_nomaskmandatew

*running it again and saving the estimates as traditional
reg cases_per_pop_log i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if mask_mandate_wright_opening_all == 0, vce(cluster fips)

estimates store traditional_nomaskmandatew

**PLOTTING THE COEFFICIENTS*****
coefplot (hybrid_nomaskmandatew, keep(1.open1_mean_cat_all#1.week_from_opening_7_5_2 1.open1_mean_cat_all#2.week_from_opening_7_5_2 1.open1_mean_cat_all#3.week_from_opening_7_5_2 1.open1_mean_cat_all#4.week_from_opening_7_5_2 1.open1_mean_cat_all#5.week_from_opening_7_5_2 1.open1_mean_cat_all#6.week_from_opening_7_5_2 1.open1_mean_cat_all#7.week_from_opening_7_5_2 1.open1_mean_cat_all#8.week_from_opening_7_5_2 1.open1_mean_cat_all#9.week_from_opening_7_5_2 1.open1_mean_cat_all#10.week_from_opening_7_5_2 1.open1_mean_cat_all#11.week_from_opening_7_5_2 1.open1_mean_cat_all#12.week_from_opening_7_5_2 1.open1_mean_cat_all#13.week_from_opening_7_5_2 1.open1_mean_cat_all#14.week_from_opening_7_5_2 1.open1_mean_cat_all#15.week_from_opening_7_5_2 1.open1_mean_cat_all#16.week_from_opening_7_5_2 1.open1_mean_cat_all#17.week_from_opening_7_5_2 1.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Hybrid) mlcolor(black))   (traditional_nomaskmandatew, keep(2.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Traditional) mlcolor(black)), yline(0, lcolor(black) lpattern(dash)) vertical rename(2.open1_mean_cat_all#1.week_from_opening_7_5_2 = 1.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 = 1.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 = 1.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 = 1.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 = 1.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 = 1.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 = 1.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 = 1.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 = 1.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 = 1.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 = 1.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 = 1.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 = 1.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 = 1.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 = 1.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 = 1.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 = 1.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2 = 1.open1_mean_cat_all#18.week_from_opening_7_5_2) coeflabels(1.open1_mean_cat_all#1.week_from_opening_7_5_2 = "-4" 1.open1_mean_cat_all#2.week_from_opening_7_5_2 = "-3" 1.open1_mean_cat_all#3.week_from_opening_7_5_2 = "-2" 1.open1_mean_cat_all#4.week_from_opening_7_5_2 = "-1" 1.open1_mean_cat_all#5.week_from_opening_7_5_2 = "0" 1.open1_mean_cat_all#6.week_from_opening_7_5_2 = "1" 1.open1_mean_cat_all#7.week_from_opening_7_5_2 = "2" 1.open1_mean_cat_all#8.week_from_opening_7_5_2 = "3" 1.open1_mean_cat_all#9.week_from_opening_7_5_2 = "4" 1.open1_mean_cat_all#10.week_from_opening_7_5_2 = "5" 1.open1_mean_cat_all#11.week_from_opening_7_5_2  = "6" 1.open1_mean_cat_all#12.week_from_opening_7_5_2 = "7" 1.open1_mean_cat_all#13.week_from_opening_7_5_2 = "8" 1.open1_mean_cat_all#14.week_from_opening_7_5_2 = "9" 1.open1_mean_cat_all#15.week_from_opening_7_5_2 = "10" 1.open1_mean_cat_all#16.week_from_opening_7_5_2 = "11" 1.open1_mean_cat_all#17.week_from_opening_7_5_2 = "12" 1.open1_mean_cat_all#18.week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)


graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - No Mask Mandate Wright - 210406.gph"
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - No Mask Mandate Wright - 210406.jpg", as(jpg) name("Graph") quality(100)



**NE only

**with mask mandate
*running it once and saving the estimates as hybrid
reg cases_per_pop_log i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if mask_mandate_wright_opening_all == 1 & region == 0, vce(cluster fips)

estimates store hybrid_maskmandatew_ne

*running it again and saving the estimates as traditional
reg cases_per_pop_log i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if mask_mandate_wright_opening_all == 1 & region == 0, vce(cluster fips)

estimates store trad_maskmandatew_ne

**PLOTTING THE COEFFICIENTS*****
coefplot (hybrid_maskmandatew_ne, keep(1.open1_mean_cat_all#1.week_from_opening_7_5_2 1.open1_mean_cat_all#2.week_from_opening_7_5_2 1.open1_mean_cat_all#3.week_from_opening_7_5_2 1.open1_mean_cat_all#4.week_from_opening_7_5_2 1.open1_mean_cat_all#5.week_from_opening_7_5_2 1.open1_mean_cat_all#6.week_from_opening_7_5_2 1.open1_mean_cat_all#7.week_from_opening_7_5_2 1.open1_mean_cat_all#8.week_from_opening_7_5_2 1.open1_mean_cat_all#9.week_from_opening_7_5_2 1.open1_mean_cat_all#10.week_from_opening_7_5_2 1.open1_mean_cat_all#11.week_from_opening_7_5_2 1.open1_mean_cat_all#12.week_from_opening_7_5_2 1.open1_mean_cat_all#13.week_from_opening_7_5_2 1.open1_mean_cat_all#14.week_from_opening_7_5_2 1.open1_mean_cat_all#15.week_from_opening_7_5_2 1.open1_mean_cat_all#16.week_from_opening_7_5_2 1.open1_mean_cat_all#17.week_from_opening_7_5_2 1.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Hybrid) mlcolor(black))   (trad_maskmandatew_ne, keep(2.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Traditional) mlcolor(black)), yline(0, lcolor(black) lpattern(dash)) vertical rename(2.open1_mean_cat_all#1.week_from_opening_7_5_2 = 1.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 = 1.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 = 1.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 = 1.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 = 1.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 = 1.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 = 1.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 = 1.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 = 1.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 = 1.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 = 1.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 = 1.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 = 1.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 = 1.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 = 1.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 = 1.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 = 1.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2 = 1.open1_mean_cat_all#18.week_from_opening_7_5_2) coeflabels(1.open1_mean_cat_all#1.week_from_opening_7_5_2 = "-4" 1.open1_mean_cat_all#2.week_from_opening_7_5_2 = "-3" 1.open1_mean_cat_all#3.week_from_opening_7_5_2 = "-2" 1.open1_mean_cat_all#4.week_from_opening_7_5_2 = "-1" 1.open1_mean_cat_all#5.week_from_opening_7_5_2 = "0" 1.open1_mean_cat_all#6.week_from_opening_7_5_2 = "1" 1.open1_mean_cat_all#7.week_from_opening_7_5_2 = "2" 1.open1_mean_cat_all#8.week_from_opening_7_5_2 = "3" 1.open1_mean_cat_all#9.week_from_opening_7_5_2 = "4" 1.open1_mean_cat_all#10.week_from_opening_7_5_2 = "5" 1.open1_mean_cat_all#11.week_from_opening_7_5_2  = "6" 1.open1_mean_cat_all#12.week_from_opening_7_5_2 = "7" 1.open1_mean_cat_all#13.week_from_opening_7_5_2 = "8" 1.open1_mean_cat_all#14.week_from_opening_7_5_2 = "9" 1.open1_mean_cat_all#15.week_from_opening_7_5_2 = "10" 1.open1_mean_cat_all#16.week_from_opening_7_5_2 = "11" 1.open1_mean_cat_all#17.week_from_opening_7_5_2 = "12" 1.open1_mean_cat_all#18.week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)


graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Mask Mandate Wright - NE - 210406.gph", replace
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Mask Mandate Wright - NE - 210406.jpg", as(jpg) name("Graph") quality(100) replace




**without mask mandate
*running it once and saving the estimates as hybrid
reg cases_per_pop_log i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if mask_mandate_wright_opening_all == 0 & region == 0, vce(cluster fips)

estimates store hybrid_nomaskmandatew_ne

*running it again and saving the estimates as traditional
reg cases_per_pop_log i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if mask_mandate_wright_opening_all == 0 & region == 0, vce(cluster fips)

estimates store trad_nomaskmandatew_ne

**PLOTTING THE COEFFICIENTS*****
coefplot (hybrid_nomaskmandatew_ne, keep(1.open1_mean_cat_all#1.week_from_opening_7_5_2 1.open1_mean_cat_all#2.week_from_opening_7_5_2 1.open1_mean_cat_all#3.week_from_opening_7_5_2 1.open1_mean_cat_all#4.week_from_opening_7_5_2 1.open1_mean_cat_all#5.week_from_opening_7_5_2 1.open1_mean_cat_all#6.week_from_opening_7_5_2 1.open1_mean_cat_all#7.week_from_opening_7_5_2 1.open1_mean_cat_all#8.week_from_opening_7_5_2 1.open1_mean_cat_all#9.week_from_opening_7_5_2 1.open1_mean_cat_all#10.week_from_opening_7_5_2 1.open1_mean_cat_all#11.week_from_opening_7_5_2 1.open1_mean_cat_all#12.week_from_opening_7_5_2 1.open1_mean_cat_all#13.week_from_opening_7_5_2 1.open1_mean_cat_all#14.week_from_opening_7_5_2 1.open1_mean_cat_all#15.week_from_opening_7_5_2 1.open1_mean_cat_all#16.week_from_opening_7_5_2 1.open1_mean_cat_all#17.week_from_opening_7_5_2 1.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Hybrid) mlcolor(black))   (trad_nomaskmandatew_ne, keep(2.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Traditional) mlcolor(black)), yline(0, lcolor(black) lpattern(dash)) vertical rename(2.open1_mean_cat_all#1.week_from_opening_7_5_2 = 1.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 = 1.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 = 1.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 = 1.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 = 1.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 = 1.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 = 1.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 = 1.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 = 1.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 = 1.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 = 1.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 = 1.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 = 1.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 = 1.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 = 1.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 = 1.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 = 1.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2 = 1.open1_mean_cat_all#18.week_from_opening_7_5_2) coeflabels(1.open1_mean_cat_all#1.week_from_opening_7_5_2 = "-4" 1.open1_mean_cat_all#2.week_from_opening_7_5_2 = "-3" 1.open1_mean_cat_all#3.week_from_opening_7_5_2 = "-2" 1.open1_mean_cat_all#4.week_from_opening_7_5_2 = "-1" 1.open1_mean_cat_all#5.week_from_opening_7_5_2 = "0" 1.open1_mean_cat_all#6.week_from_opening_7_5_2 = "1" 1.open1_mean_cat_all#7.week_from_opening_7_5_2 = "2" 1.open1_mean_cat_all#8.week_from_opening_7_5_2 = "3" 1.open1_mean_cat_all#9.week_from_opening_7_5_2 = "4" 1.open1_mean_cat_all#10.week_from_opening_7_5_2 = "5" 1.open1_mean_cat_all#11.week_from_opening_7_5_2  = "6" 1.open1_mean_cat_all#12.week_from_opening_7_5_2 = "7" 1.open1_mean_cat_all#13.week_from_opening_7_5_2 = "8" 1.open1_mean_cat_all#14.week_from_opening_7_5_2 = "9" 1.open1_mean_cat_all#15.week_from_opening_7_5_2 = "10" 1.open1_mean_cat_all#16.week_from_opening_7_5_2 = "11" 1.open1_mean_cat_all#17.week_from_opening_7_5_2 = "12" 1.open1_mean_cat_all#18.week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)


graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - No Mask Mandate Wright - NE - 210406.gph", replace
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - No Mask Mandate Wright - NE - 210406.jpg", as(jpg) name("Graph") quality(100) replace







**W only

**with mask mandate
*running it once and saving the estimates as hybrid
reg cases_per_pop_log i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if mask_mandate_wright_opening_all == 1 & region == 1, vce(cluster fips)

estimates store hybrid_maskmandatew_w

*running it again and saving the estimates as traditional
reg cases_per_pop_log i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if mask_mandate_wright_opening_all == 1 & region == 1, vce(cluster fips)

estimates store trad_maskmandatew_w

**PLOTTING THE COEFFICIENTS*****
coefplot (hybrid_maskmandatew_w, keep(1.open1_mean_cat_all#1.week_from_opening_7_5_2 1.open1_mean_cat_all#2.week_from_opening_7_5_2 1.open1_mean_cat_all#3.week_from_opening_7_5_2 1.open1_mean_cat_all#4.week_from_opening_7_5_2 1.open1_mean_cat_all#5.week_from_opening_7_5_2 1.open1_mean_cat_all#6.week_from_opening_7_5_2 1.open1_mean_cat_all#7.week_from_opening_7_5_2 1.open1_mean_cat_all#8.week_from_opening_7_5_2 1.open1_mean_cat_all#9.week_from_opening_7_5_2 1.open1_mean_cat_all#10.week_from_opening_7_5_2 1.open1_mean_cat_all#11.week_from_opening_7_5_2 1.open1_mean_cat_all#12.week_from_opening_7_5_2 1.open1_mean_cat_all#13.week_from_opening_7_5_2 1.open1_mean_cat_all#14.week_from_opening_7_5_2 1.open1_mean_cat_all#15.week_from_opening_7_5_2 1.open1_mean_cat_all#16.week_from_opening_7_5_2 1.open1_mean_cat_all#17.week_from_opening_7_5_2 1.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Hybrid) mlcolor(black))   (trad_maskmandatew_w, keep(2.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Traditional) mlcolor(black)), yline(0, lcolor(black) lpattern(dash)) vertical rename(2.open1_mean_cat_all#1.week_from_opening_7_5_2 = 1.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 = 1.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 = 1.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 = 1.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 = 1.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 = 1.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 = 1.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 = 1.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 = 1.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 = 1.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 = 1.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 = 1.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 = 1.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 = 1.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 = 1.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 = 1.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 = 1.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2 = 1.open1_mean_cat_all#18.week_from_opening_7_5_2) coeflabels(1.open1_mean_cat_all#1.week_from_opening_7_5_2 = "-4" 1.open1_mean_cat_all#2.week_from_opening_7_5_2 = "-3" 1.open1_mean_cat_all#3.week_from_opening_7_5_2 = "-2" 1.open1_mean_cat_all#4.week_from_opening_7_5_2 = "-1" 1.open1_mean_cat_all#5.week_from_opening_7_5_2 = "0" 1.open1_mean_cat_all#6.week_from_opening_7_5_2 = "1" 1.open1_mean_cat_all#7.week_from_opening_7_5_2 = "2" 1.open1_mean_cat_all#8.week_from_opening_7_5_2 = "3" 1.open1_mean_cat_all#9.week_from_opening_7_5_2 = "4" 1.open1_mean_cat_all#10.week_from_opening_7_5_2 = "5" 1.open1_mean_cat_all#11.week_from_opening_7_5_2  = "6" 1.open1_mean_cat_all#12.week_from_opening_7_5_2 = "7" 1.open1_mean_cat_all#13.week_from_opening_7_5_2 = "8" 1.open1_mean_cat_all#14.week_from_opening_7_5_2 = "9" 1.open1_mean_cat_all#15.week_from_opening_7_5_2 = "10" 1.open1_mean_cat_all#16.week_from_opening_7_5_2 = "11" 1.open1_mean_cat_all#17.week_from_opening_7_5_2 = "12" 1.open1_mean_cat_all#18.week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)


graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Mask Mandate Wright - W - 210406.gph", replace
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Mask Mandate Wright - W - 210406.jpg", as(jpg) name("Graph") quality(100) replace




**without mask mandate
*running it once and saving the estimates as hybrid
reg cases_per_pop_log i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if mask_mandate_wright_opening_all == 0 & region == 1, vce(cluster fips)

estimates store hybrid_nomaskmandatew_w

*running it again and saving the estimates as traditional
reg cases_per_pop_log i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if mask_mandate_wright_opening_all == 0 & region == 1, vce(cluster fips)

estimates store trad_nomaskmandatew_w

**PLOTTING THE COEFFICIENTS*****
coefplot (hybrid_nomaskmandatew_w, keep(1.open1_mean_cat_all#1.week_from_opening_7_5_2 1.open1_mean_cat_all#2.week_from_opening_7_5_2 1.open1_mean_cat_all#3.week_from_opening_7_5_2 1.open1_mean_cat_all#4.week_from_opening_7_5_2 1.open1_mean_cat_all#5.week_from_opening_7_5_2 1.open1_mean_cat_all#6.week_from_opening_7_5_2 1.open1_mean_cat_all#7.week_from_opening_7_5_2 1.open1_mean_cat_all#8.week_from_opening_7_5_2 1.open1_mean_cat_all#9.week_from_opening_7_5_2 1.open1_mean_cat_all#10.week_from_opening_7_5_2 1.open1_mean_cat_all#11.week_from_opening_7_5_2 1.open1_mean_cat_all#12.week_from_opening_7_5_2 1.open1_mean_cat_all#13.week_from_opening_7_5_2 1.open1_mean_cat_all#14.week_from_opening_7_5_2 1.open1_mean_cat_all#15.week_from_opening_7_5_2 1.open1_mean_cat_all#16.week_from_opening_7_5_2 1.open1_mean_cat_all#17.week_from_opening_7_5_2 1.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Hybrid) mlcolor(black))   (trad_nomaskmandatew_w, keep(2.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Traditional) mlcolor(black)), yline(0, lcolor(black) lpattern(dash)) vertical rename(2.open1_mean_cat_all#1.week_from_opening_7_5_2 = 1.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 = 1.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 = 1.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 = 1.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 = 1.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 = 1.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 = 1.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 = 1.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 = 1.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 = 1.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 = 1.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 = 1.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 = 1.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 = 1.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 = 1.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 = 1.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 = 1.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2 = 1.open1_mean_cat_all#18.week_from_opening_7_5_2) coeflabels(1.open1_mean_cat_all#1.week_from_opening_7_5_2 = "-4" 1.open1_mean_cat_all#2.week_from_opening_7_5_2 = "-3" 1.open1_mean_cat_all#3.week_from_opening_7_5_2 = "-2" 1.open1_mean_cat_all#4.week_from_opening_7_5_2 = "-1" 1.open1_mean_cat_all#5.week_from_opening_7_5_2 = "0" 1.open1_mean_cat_all#6.week_from_opening_7_5_2 = "1" 1.open1_mean_cat_all#7.week_from_opening_7_5_2 = "2" 1.open1_mean_cat_all#8.week_from_opening_7_5_2 = "3" 1.open1_mean_cat_all#9.week_from_opening_7_5_2 = "4" 1.open1_mean_cat_all#10.week_from_opening_7_5_2 = "5" 1.open1_mean_cat_all#11.week_from_opening_7_5_2  = "6" 1.open1_mean_cat_all#12.week_from_opening_7_5_2 = "7" 1.open1_mean_cat_all#13.week_from_opening_7_5_2 = "8" 1.open1_mean_cat_all#14.week_from_opening_7_5_2 = "9" 1.open1_mean_cat_all#15.week_from_opening_7_5_2 = "10" 1.open1_mean_cat_all#16.week_from_opening_7_5_2 = "11" 1.open1_mean_cat_all#17.week_from_opening_7_5_2 = "12" 1.open1_mean_cat_all#18.week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)


graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - No Mask Mandate Wright - W - 210406.gph", replace
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - No Mask Mandate Wright - W - 210406.jpg", as(jpg) name("Graph") quality(100) replace




**MW only

**with mask mandate
*running it once and saving the estimates as hybrid
reg cases_per_pop_log i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if mask_mandate_wright_opening_all == 1 & region == 2, vce(cluster fips)

estimates store hybrid_maskmandatew_mw

*running it again and saving the estimates as traditional
reg cases_per_pop_log i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if mask_mandate_wright_opening_all == 1 & region == 2, vce(cluster fips)

estimates store trad_maskmandatew_mw

**PLOTTING THE COEFFICIENTS*****
coefplot (hybrid_maskmandatew_mw, keep(1.open1_mean_cat_all#1.week_from_opening_7_5_2 1.open1_mean_cat_all#2.week_from_opening_7_5_2 1.open1_mean_cat_all#3.week_from_opening_7_5_2 1.open1_mean_cat_all#4.week_from_opening_7_5_2 1.open1_mean_cat_all#5.week_from_opening_7_5_2 1.open1_mean_cat_all#6.week_from_opening_7_5_2 1.open1_mean_cat_all#7.week_from_opening_7_5_2 1.open1_mean_cat_all#8.week_from_opening_7_5_2 1.open1_mean_cat_all#9.week_from_opening_7_5_2 1.open1_mean_cat_all#10.week_from_opening_7_5_2 1.open1_mean_cat_all#11.week_from_opening_7_5_2 1.open1_mean_cat_all#12.week_from_opening_7_5_2 1.open1_mean_cat_all#13.week_from_opening_7_5_2 1.open1_mean_cat_all#14.week_from_opening_7_5_2 1.open1_mean_cat_all#15.week_from_opening_7_5_2 1.open1_mean_cat_all#16.week_from_opening_7_5_2 1.open1_mean_cat_all#17.week_from_opening_7_5_2 1.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Hybrid) mlcolor(black))   (trad_maskmandatew_mw, keep(2.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Traditional) mlcolor(black)), yline(0, lcolor(black) lpattern(dash)) vertical rename(2.open1_mean_cat_all#1.week_from_opening_7_5_2 = 1.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 = 1.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 = 1.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 = 1.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 = 1.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 = 1.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 = 1.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 = 1.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 = 1.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 = 1.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 = 1.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 = 1.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 = 1.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 = 1.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 = 1.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 = 1.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 = 1.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2 = 1.open1_mean_cat_all#18.week_from_opening_7_5_2) coeflabels(1.open1_mean_cat_all#1.week_from_opening_7_5_2 = "-4" 1.open1_mean_cat_all#2.week_from_opening_7_5_2 = "-3" 1.open1_mean_cat_all#3.week_from_opening_7_5_2 = "-2" 1.open1_mean_cat_all#4.week_from_opening_7_5_2 = "-1" 1.open1_mean_cat_all#5.week_from_opening_7_5_2 = "0" 1.open1_mean_cat_all#6.week_from_opening_7_5_2 = "1" 1.open1_mean_cat_all#7.week_from_opening_7_5_2 = "2" 1.open1_mean_cat_all#8.week_from_opening_7_5_2 = "3" 1.open1_mean_cat_all#9.week_from_opening_7_5_2 = "4" 1.open1_mean_cat_all#10.week_from_opening_7_5_2 = "5" 1.open1_mean_cat_all#11.week_from_opening_7_5_2  = "6" 1.open1_mean_cat_all#12.week_from_opening_7_5_2 = "7" 1.open1_mean_cat_all#13.week_from_opening_7_5_2 = "8" 1.open1_mean_cat_all#14.week_from_opening_7_5_2 = "9" 1.open1_mean_cat_all#15.week_from_opening_7_5_2 = "10" 1.open1_mean_cat_all#16.week_from_opening_7_5_2 = "11" 1.open1_mean_cat_all#17.week_from_opening_7_5_2 = "12" 1.open1_mean_cat_all#18.week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)


graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Mask Mandate Wright - MW - 210406.gph", replace
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Mask Mandate Wright - MW - 210406.jpg", as(jpg) name("Graph") quality(100) replace




**without mask mandate
*running it once and saving the estimates as hybrid
reg cases_per_pop_log i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if mask_mandate_wright_opening_all == 0 & region == 2, vce(cluster fips)

estimates store hybrid_nomaskmandatew_mw

*running it again and saving the estimates as traditional
reg cases_per_pop_log i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if mask_mandate_wright_opening_all == 0 & region == 2, vce(cluster fips)

estimates store trad_nomaskmandatew_mw

**PLOTTING THE COEFFICIENTS*****
coefplot (hybrid_nomaskmandatew_mw, keep(1.open1_mean_cat_all#1.week_from_opening_7_5_2 1.open1_mean_cat_all#2.week_from_opening_7_5_2 1.open1_mean_cat_all#3.week_from_opening_7_5_2 1.open1_mean_cat_all#4.week_from_opening_7_5_2 1.open1_mean_cat_all#5.week_from_opening_7_5_2 1.open1_mean_cat_all#6.week_from_opening_7_5_2 1.open1_mean_cat_all#7.week_from_opening_7_5_2 1.open1_mean_cat_all#8.week_from_opening_7_5_2 1.open1_mean_cat_all#9.week_from_opening_7_5_2 1.open1_mean_cat_all#10.week_from_opening_7_5_2 1.open1_mean_cat_all#11.week_from_opening_7_5_2 1.open1_mean_cat_all#12.week_from_opening_7_5_2 1.open1_mean_cat_all#13.week_from_opening_7_5_2 1.open1_mean_cat_all#14.week_from_opening_7_5_2 1.open1_mean_cat_all#15.week_from_opening_7_5_2 1.open1_mean_cat_all#16.week_from_opening_7_5_2 1.open1_mean_cat_all#17.week_from_opening_7_5_2 1.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Hybrid) mlcolor(black))   (trad_nomaskmandatew_mw, keep(2.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Traditional) mlcolor(black)), yline(0, lcolor(black) lpattern(dash)) vertical rename(2.open1_mean_cat_all#1.week_from_opening_7_5_2 = 1.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 = 1.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 = 1.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 = 1.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 = 1.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 = 1.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 = 1.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 = 1.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 = 1.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 = 1.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 = 1.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 = 1.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 = 1.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 = 1.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 = 1.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 = 1.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 = 1.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2 = 1.open1_mean_cat_all#18.week_from_opening_7_5_2) coeflabels(1.open1_mean_cat_all#1.week_from_opening_7_5_2 = "-4" 1.open1_mean_cat_all#2.week_from_opening_7_5_2 = "-3" 1.open1_mean_cat_all#3.week_from_opening_7_5_2 = "-2" 1.open1_mean_cat_all#4.week_from_opening_7_5_2 = "-1" 1.open1_mean_cat_all#5.week_from_opening_7_5_2 = "0" 1.open1_mean_cat_all#6.week_from_opening_7_5_2 = "1" 1.open1_mean_cat_all#7.week_from_opening_7_5_2 = "2" 1.open1_mean_cat_all#8.week_from_opening_7_5_2 = "3" 1.open1_mean_cat_all#9.week_from_opening_7_5_2 = "4" 1.open1_mean_cat_all#10.week_from_opening_7_5_2 = "5" 1.open1_mean_cat_all#11.week_from_opening_7_5_2  = "6" 1.open1_mean_cat_all#12.week_from_opening_7_5_2 = "7" 1.open1_mean_cat_all#13.week_from_opening_7_5_2 = "8" 1.open1_mean_cat_all#14.week_from_opening_7_5_2 = "9" 1.open1_mean_cat_all#15.week_from_opening_7_5_2 = "10" 1.open1_mean_cat_all#16.week_from_opening_7_5_2 = "11" 1.open1_mean_cat_all#17.week_from_opening_7_5_2 = "12" 1.open1_mean_cat_all#18.week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)


graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - No Mask Mandate Wright - MW - 210406.gph", replace
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - No Mask Mandate Wright - MW - 210406.jpg", as(jpg) name("Graph") quality(100) replace






**S only

**with mask mandate
*running it once and saving the estimates as hybrid
reg cases_per_pop_log i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if mask_mandate_wright_opening_all == 1 & region == 3, vce(cluster fips)

estimates store hybrid_maskmandatew_s

*running it again and saving the estimates as traditional
reg cases_per_pop_log i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if mask_mandate_wright_opening_all == 1 & region == 3, vce(cluster fips)

estimates store trad_maskmandatew_s

**PLOTTING THE COEFFICIENTS*****
coefplot (hybrid_maskmandatew_s, keep(1.open1_mean_cat_all#1.week_from_opening_7_5_2 1.open1_mean_cat_all#2.week_from_opening_7_5_2 1.open1_mean_cat_all#3.week_from_opening_7_5_2 1.open1_mean_cat_all#4.week_from_opening_7_5_2 1.open1_mean_cat_all#5.week_from_opening_7_5_2 1.open1_mean_cat_all#6.week_from_opening_7_5_2 1.open1_mean_cat_all#7.week_from_opening_7_5_2 1.open1_mean_cat_all#8.week_from_opening_7_5_2 1.open1_mean_cat_all#9.week_from_opening_7_5_2 1.open1_mean_cat_all#10.week_from_opening_7_5_2 1.open1_mean_cat_all#11.week_from_opening_7_5_2 1.open1_mean_cat_all#12.week_from_opening_7_5_2 1.open1_mean_cat_all#13.week_from_opening_7_5_2 1.open1_mean_cat_all#14.week_from_opening_7_5_2 1.open1_mean_cat_all#15.week_from_opening_7_5_2 1.open1_mean_cat_all#16.week_from_opening_7_5_2 1.open1_mean_cat_all#17.week_from_opening_7_5_2 1.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Hybrid) mlcolor(black))   (trad_maskmandatew_s, keep(2.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Traditional) mlcolor(black)), yline(0, lcolor(black) lpattern(dash)) vertical rename(2.open1_mean_cat_all#1.week_from_opening_7_5_2 = 1.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 = 1.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 = 1.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 = 1.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 = 1.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 = 1.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 = 1.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 = 1.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 = 1.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 = 1.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 = 1.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 = 1.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 = 1.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 = 1.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 = 1.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 = 1.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 = 1.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2 = 1.open1_mean_cat_all#18.week_from_opening_7_5_2) coeflabels(1.open1_mean_cat_all#1.week_from_opening_7_5_2 = "-4" 1.open1_mean_cat_all#2.week_from_opening_7_5_2 = "-3" 1.open1_mean_cat_all#3.week_from_opening_7_5_2 = "-2" 1.open1_mean_cat_all#4.week_from_opening_7_5_2 = "-1" 1.open1_mean_cat_all#5.week_from_opening_7_5_2 = "0" 1.open1_mean_cat_all#6.week_from_opening_7_5_2 = "1" 1.open1_mean_cat_all#7.week_from_opening_7_5_2 = "2" 1.open1_mean_cat_all#8.week_from_opening_7_5_2 = "3" 1.open1_mean_cat_all#9.week_from_opening_7_5_2 = "4" 1.open1_mean_cat_all#10.week_from_opening_7_5_2 = "5" 1.open1_mean_cat_all#11.week_from_opening_7_5_2  = "6" 1.open1_mean_cat_all#12.week_from_opening_7_5_2 = "7" 1.open1_mean_cat_all#13.week_from_opening_7_5_2 = "8" 1.open1_mean_cat_all#14.week_from_opening_7_5_2 = "9" 1.open1_mean_cat_all#15.week_from_opening_7_5_2 = "10" 1.open1_mean_cat_all#16.week_from_opening_7_5_2 = "11" 1.open1_mean_cat_all#17.week_from_opening_7_5_2 = "12" 1.open1_mean_cat_all#18.week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)


graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Mask Mandate Wright - S - 210406.gph", replace
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Mask Mandate Wright - S - 210406.jpg", as(jpg) name("Graph") quality(100) replace




**without mask mandate
*running it once and saving the estimates as hybrid
reg cases_per_pop_log i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if mask_mandate_wright_opening_all == 0 & region == 3, vce(cluster fips)

estimates store hybrid_nomaskmandatew_s

*running it again and saving the estimates as traditional
reg cases_per_pop_log i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if mask_mandate_wright_opening_all == 0 & region == 3, vce(cluster fips)

estimates store trad_nomaskmandatew_s

**PLOTTING THE COEFFICIENTS*****
coefplot (hybrid_nomaskmandatew_s, keep(1.open1_mean_cat_all#1.week_from_opening_7_5_2 1.open1_mean_cat_all#2.week_from_opening_7_5_2 1.open1_mean_cat_all#3.week_from_opening_7_5_2 1.open1_mean_cat_all#4.week_from_opening_7_5_2 1.open1_mean_cat_all#5.week_from_opening_7_5_2 1.open1_mean_cat_all#6.week_from_opening_7_5_2 1.open1_mean_cat_all#7.week_from_opening_7_5_2 1.open1_mean_cat_all#8.week_from_opening_7_5_2 1.open1_mean_cat_all#9.week_from_opening_7_5_2 1.open1_mean_cat_all#10.week_from_opening_7_5_2 1.open1_mean_cat_all#11.week_from_opening_7_5_2 1.open1_mean_cat_all#12.week_from_opening_7_5_2 1.open1_mean_cat_all#13.week_from_opening_7_5_2 1.open1_mean_cat_all#14.week_from_opening_7_5_2 1.open1_mean_cat_all#15.week_from_opening_7_5_2 1.open1_mean_cat_all#16.week_from_opening_7_5_2 1.open1_mean_cat_all#17.week_from_opening_7_5_2 1.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Hybrid) mlcolor(black))   (trad_nomaskmandatew_s, keep(2.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Traditional) mlcolor(black)), yline(0, lcolor(black) lpattern(dash)) vertical rename(2.open1_mean_cat_all#1.week_from_opening_7_5_2 = 1.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 = 1.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 = 1.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 = 1.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 = 1.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 = 1.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 = 1.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 = 1.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 = 1.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 = 1.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 = 1.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 = 1.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 = 1.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 = 1.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 = 1.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 = 1.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 = 1.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2 = 1.open1_mean_cat_all#18.week_from_opening_7_5_2) coeflabels(1.open1_mean_cat_all#1.week_from_opening_7_5_2 = "-4" 1.open1_mean_cat_all#2.week_from_opening_7_5_2 = "-3" 1.open1_mean_cat_all#3.week_from_opening_7_5_2 = "-2" 1.open1_mean_cat_all#4.week_from_opening_7_5_2 = "-1" 1.open1_mean_cat_all#5.week_from_opening_7_5_2 = "0" 1.open1_mean_cat_all#6.week_from_opening_7_5_2 = "1" 1.open1_mean_cat_all#7.week_from_opening_7_5_2 = "2" 1.open1_mean_cat_all#8.week_from_opening_7_5_2 = "3" 1.open1_mean_cat_all#9.week_from_opening_7_5_2 = "4" 1.open1_mean_cat_all#10.week_from_opening_7_5_2 = "5" 1.open1_mean_cat_all#11.week_from_opening_7_5_2  = "6" 1.open1_mean_cat_all#12.week_from_opening_7_5_2 = "7" 1.open1_mean_cat_all#13.week_from_opening_7_5_2 = "8" 1.open1_mean_cat_all#14.week_from_opening_7_5_2 = "9" 1.open1_mean_cat_all#15.week_from_opening_7_5_2 = "10" 1.open1_mean_cat_all#16.week_from_opening_7_5_2 = "11" 1.open1_mean_cat_all#17.week_from_opening_7_5_2 = "12" 1.open1_mean_cat_all#18.week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)


graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - No Mask Mandate Wright - S - 210406.gph", replace
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - No Mask Mandate Wright - S - 210406.jpg", as(jpg) name("Graph") quality(100) replace



**THE SOUTHERN REGION STATES WITH A POSITIVE ASSOCIATION BETWEEN SCHOOL MODE AND CASES WITH MASK MANDATE***
**with mask mandate
*running it once and saving the estimates as hybrid
reg cases_per_pop_log i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if mask_mandate_wright_opening_all == 1 & region == 3 & inlist(state,"AL", "MS", "TN", "TX", "VA", "WV"), vce(cluster fips)

estimates store hybrid_maskmandatew_s_pos

*running it again and saving the estimates as traditional
reg cases_per_pop_log i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if mask_mandate_wright_opening_all == 1 & region == 3 & inlist(state,"AL", "MS", "TN", "TX", "VA", "WV"), vce(cluster fips)

estimates store trad_maskmandatew_s_pos

**PLOTTING THE COEFFICIENTS*****
coefplot (hybrid_maskmandatew_s_pos, keep(1.open1_mean_cat_all#1.week_from_opening_7_5_2 1.open1_mean_cat_all#2.week_from_opening_7_5_2 1.open1_mean_cat_all#3.week_from_opening_7_5_2 1.open1_mean_cat_all#4.week_from_opening_7_5_2 1.open1_mean_cat_all#5.week_from_opening_7_5_2 1.open1_mean_cat_all#6.week_from_opening_7_5_2 1.open1_mean_cat_all#7.week_from_opening_7_5_2 1.open1_mean_cat_all#8.week_from_opening_7_5_2 1.open1_mean_cat_all#9.week_from_opening_7_5_2 1.open1_mean_cat_all#10.week_from_opening_7_5_2 1.open1_mean_cat_all#11.week_from_opening_7_5_2 1.open1_mean_cat_all#12.week_from_opening_7_5_2 1.open1_mean_cat_all#13.week_from_opening_7_5_2 1.open1_mean_cat_all#14.week_from_opening_7_5_2 1.open1_mean_cat_all#15.week_from_opening_7_5_2 1.open1_mean_cat_all#16.week_from_opening_7_5_2 1.open1_mean_cat_all#17.week_from_opening_7_5_2 1.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Hybrid) mlcolor(black))   (trad_maskmandatew_s_pos, keep(2.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Traditional) mlcolor(black)), yline(0, lcolor(black) lpattern(dash)) vertical rename(2.open1_mean_cat_all#1.week_from_opening_7_5_2 = 1.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 = 1.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 = 1.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 = 1.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 = 1.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 = 1.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 = 1.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 = 1.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 = 1.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 = 1.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 = 1.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 = 1.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 = 1.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 = 1.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 = 1.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 = 1.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 = 1.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2 = 1.open1_mean_cat_all#18.week_from_opening_7_5_2) coeflabels(1.open1_mean_cat_all#1.week_from_opening_7_5_2 = "-4" 1.open1_mean_cat_all#2.week_from_opening_7_5_2 = "-3" 1.open1_mean_cat_all#3.week_from_opening_7_5_2 = "-2" 1.open1_mean_cat_all#4.week_from_opening_7_5_2 = "-1" 1.open1_mean_cat_all#5.week_from_opening_7_5_2 = "0" 1.open1_mean_cat_all#6.week_from_opening_7_5_2 = "1" 1.open1_mean_cat_all#7.week_from_opening_7_5_2 = "2" 1.open1_mean_cat_all#8.week_from_opening_7_5_2 = "3" 1.open1_mean_cat_all#9.week_from_opening_7_5_2 = "4" 1.open1_mean_cat_all#10.week_from_opening_7_5_2 = "5" 1.open1_mean_cat_all#11.week_from_opening_7_5_2  = "6" 1.open1_mean_cat_all#12.week_from_opening_7_5_2 = "7" 1.open1_mean_cat_all#13.week_from_opening_7_5_2 = "8" 1.open1_mean_cat_all#14.week_from_opening_7_5_2 = "9" 1.open1_mean_cat_all#15.week_from_opening_7_5_2 = "10" 1.open1_mean_cat_all#16.week_from_opening_7_5_2 = "11" 1.open1_mean_cat_all#17.week_from_opening_7_5_2 = "12" 1.open1_mean_cat_all#18.week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)


graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Mask Mandate Wright - S Positive Association - 210406.gph", replace
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Mask Mandate Wright - S Positive Association - 210406.jpg", as(jpg) name("Graph") quality(100) replace



**THE SOUTHERN REGION STATES WITH NO ASSOCIATION BETWEEN SCHOOL MODE AND CASES WITH MASK MANDATE***
**with mask mandate
*running it once and saving the estimates as hybrid
reg cases_per_pop_log i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if mask_mandate_wright_opening_all == 1 & region == 3 & inlist(state,"AR", "FL", "GA", "KY", "MD", "NC", "OK", "SC"), vce(cluster fips)

estimates store hybrid_maskmandatew_s_no

*running it again and saving the estimates as traditional
reg cases_per_pop_log i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if mask_mandate_wright_opening_all == 1 & region == 3 & inlist(state,"AR", "FL", "GA", "KY", "MD", "NC", "OK", "SC"), vce(cluster fips)

estimates store trad_maskmandatew_s_no

**PLOTTING THE COEFFICIENTS*****
coefplot (hybrid_maskmandatew_s_no, keep(1.open1_mean_cat_all#1.week_from_opening_7_5_2 1.open1_mean_cat_all#2.week_from_opening_7_5_2 1.open1_mean_cat_all#3.week_from_opening_7_5_2 1.open1_mean_cat_all#4.week_from_opening_7_5_2 1.open1_mean_cat_all#5.week_from_opening_7_5_2 1.open1_mean_cat_all#6.week_from_opening_7_5_2 1.open1_mean_cat_all#7.week_from_opening_7_5_2 1.open1_mean_cat_all#8.week_from_opening_7_5_2 1.open1_mean_cat_all#9.week_from_opening_7_5_2 1.open1_mean_cat_all#10.week_from_opening_7_5_2 1.open1_mean_cat_all#11.week_from_opening_7_5_2 1.open1_mean_cat_all#12.week_from_opening_7_5_2 1.open1_mean_cat_all#13.week_from_opening_7_5_2 1.open1_mean_cat_all#14.week_from_opening_7_5_2 1.open1_mean_cat_all#15.week_from_opening_7_5_2 1.open1_mean_cat_all#16.week_from_opening_7_5_2 1.open1_mean_cat_all#17.week_from_opening_7_5_2 1.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Hybrid) mlcolor(black))   (trad_maskmandatew_s_no, keep(2.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Traditional) mlcolor(black)), yline(0, lcolor(black) lpattern(dash)) vertical rename(2.open1_mean_cat_all#1.week_from_opening_7_5_2 = 1.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 = 1.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 = 1.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 = 1.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 = 1.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 = 1.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 = 1.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 = 1.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 = 1.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 = 1.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 = 1.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 = 1.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 = 1.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 = 1.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 = 1.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 = 1.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 = 1.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2 = 1.open1_mean_cat_all#18.week_from_opening_7_5_2) coeflabels(1.open1_mean_cat_all#1.week_from_opening_7_5_2 = "-4" 1.open1_mean_cat_all#2.week_from_opening_7_5_2 = "-3" 1.open1_mean_cat_all#3.week_from_opening_7_5_2 = "-2" 1.open1_mean_cat_all#4.week_from_opening_7_5_2 = "-1" 1.open1_mean_cat_all#5.week_from_opening_7_5_2 = "0" 1.open1_mean_cat_all#6.week_from_opening_7_5_2 = "1" 1.open1_mean_cat_all#7.week_from_opening_7_5_2 = "2" 1.open1_mean_cat_all#8.week_from_opening_7_5_2 = "3" 1.open1_mean_cat_all#9.week_from_opening_7_5_2 = "4" 1.open1_mean_cat_all#10.week_from_opening_7_5_2 = "5" 1.open1_mean_cat_all#11.week_from_opening_7_5_2  = "6" 1.open1_mean_cat_all#12.week_from_opening_7_5_2 = "7" 1.open1_mean_cat_all#13.week_from_opening_7_5_2 = "8" 1.open1_mean_cat_all#14.week_from_opening_7_5_2 = "9" 1.open1_mean_cat_all#15.week_from_opening_7_5_2 = "10" 1.open1_mean_cat_all#16.week_from_opening_7_5_2 = "11" 1.open1_mean_cat_all#17.week_from_opening_7_5_2 = "12" 1.open1_mean_cat_all#18.week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)


graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Mask Mandate Wright - S No Association - 210406.gph", replace
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Mask Mandate Wright - S No Association - 210406.jpg", as(jpg) name("Graph") quality(100) replace





*****************************
****CHANGE FROM BASELINE******
****MASK MANDATE 4********
*****************************


**WITH MASK MANDATE
**overall
*running it once and saving the estimates as hybrid
reg cases_per_pop_bl_diff i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if h6_facialcoverings4_all == 1, vce(cluster fips)

estimates store change_bl_hybrid_mm_overall

*running it again and saving the estimates as traditional
reg cases_per_pop_bl_diff i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if h6_facialcoverings4_all == 1, vce(cluster fips)

estimates store change_bl_trad_mm_overall

**PLOTTING THE COEFFICIENTS*****
coefplot (change_bl_hybrid_mm_overall, keep(1.open1_mean_cat_all#1.week_from_opening_7_5_2 1.open1_mean_cat_all#2.week_from_opening_7_5_2 1.open1_mean_cat_all#3.week_from_opening_7_5_2 1.open1_mean_cat_all#4.week_from_opening_7_5_2 1.open1_mean_cat_all#5.week_from_opening_7_5_2 1.open1_mean_cat_all#6.week_from_opening_7_5_2 1.open1_mean_cat_all#7.week_from_opening_7_5_2 1.open1_mean_cat_all#8.week_from_opening_7_5_2 1.open1_mean_cat_all#9.week_from_opening_7_5_2 1.open1_mean_cat_all#10.week_from_opening_7_5_2 1.open1_mean_cat_all#11.week_from_opening_7_5_2 1.open1_mean_cat_all#12.week_from_opening_7_5_2 1.open1_mean_cat_all#13.week_from_opening_7_5_2 1.open1_mean_cat_all#14.week_from_opening_7_5_2 1.open1_mean_cat_all#15.week_from_opening_7_5_2 1.open1_mean_cat_all#16.week_from_opening_7_5_2 1.open1_mean_cat_all#17.week_from_opening_7_5_2 1.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Hybrid) mlcolor(black))   (change_bl_trad_mm_overall, keep(2.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Traditional) mlcolor(black)), yline(0, lcolor(black) lpattern(dash)) vertical rename(2.open1_mean_cat_all#1.week_from_opening_7_5_2 = 1.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 = 1.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 = 1.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 = 1.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 = 1.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 = 1.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 = 1.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 = 1.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 = 1.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 = 1.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 = 1.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 = 1.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 = 1.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 = 1.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 = 1.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 = 1.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 = 1.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2 = 1.open1_mean_cat_all#18.week_from_opening_7_5_2) coeflabels(1.open1_mean_cat_all#1.week_from_opening_7_5_2 = "-4" 1.open1_mean_cat_all#2.week_from_opening_7_5_2 = "-3" 1.open1_mean_cat_all#3.week_from_opening_7_5_2 = "-2" 1.open1_mean_cat_all#4.week_from_opening_7_5_2 = "-1" 1.open1_mean_cat_all#5.week_from_opening_7_5_2 = "0" 1.open1_mean_cat_all#6.week_from_opening_7_5_2 = "1" 1.open1_mean_cat_all#7.week_from_opening_7_5_2 = "2" 1.open1_mean_cat_all#8.week_from_opening_7_5_2 = "3" 1.open1_mean_cat_all#9.week_from_opening_7_5_2 = "4" 1.open1_mean_cat_all#10.week_from_opening_7_5_2 = "5" 1.open1_mean_cat_all#11.week_from_opening_7_5_2  = "6" 1.open1_mean_cat_all#12.week_from_opening_7_5_2 = "7" 1.open1_mean_cat_all#13.week_from_opening_7_5_2 = "8" 1.open1_mean_cat_all#14.week_from_opening_7_5_2 = "9" 1.open1_mean_cat_all#15.week_from_opening_7_5_2 = "10" 1.open1_mean_cat_all#16.week_from_opening_7_5_2 = "11" 1.open1_mean_cat_all#17.week_from_opening_7_5_2 = "12" 1.open1_mean_cat_all#18.week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)


graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Change from Baseline - Mask Mandate 4 - 210406.gph", replace
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Change from Baseline - Mask Mandate 4 - 210406.jpg", as(jpg) name("Graph") quality(100) replace



***WITHOUT MASK MANDATE 4
**overall
*running it once and saving the estimates as hybrid
reg cases_per_pop_bl_diff i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if h6_facialcoverings4_all == 0, vce(cluster fips)

estimates store change_bl_hybrid_nomm_all

*running it again and saving the estimates as traditional
reg cases_per_pop_bl_diff i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if h6_facialcoverings4_all == 0, vce(cluster fips)

estimates store change_bl_trad_nomm_all

**PLOTTING THE COEFFICIENTS*****
coefplot (change_bl_hybrid_nomm_all, keep(1.open1_mean_cat_all#1.week_from_opening_7_5_2 1.open1_mean_cat_all#2.week_from_opening_7_5_2 1.open1_mean_cat_all#3.week_from_opening_7_5_2 1.open1_mean_cat_all#4.week_from_opening_7_5_2 1.open1_mean_cat_all#5.week_from_opening_7_5_2 1.open1_mean_cat_all#6.week_from_opening_7_5_2 1.open1_mean_cat_all#7.week_from_opening_7_5_2 1.open1_mean_cat_all#8.week_from_opening_7_5_2 1.open1_mean_cat_all#9.week_from_opening_7_5_2 1.open1_mean_cat_all#10.week_from_opening_7_5_2 1.open1_mean_cat_all#11.week_from_opening_7_5_2 1.open1_mean_cat_all#12.week_from_opening_7_5_2 1.open1_mean_cat_all#13.week_from_opening_7_5_2 1.open1_mean_cat_all#14.week_from_opening_7_5_2 1.open1_mean_cat_all#15.week_from_opening_7_5_2 1.open1_mean_cat_all#16.week_from_opening_7_5_2 1.open1_mean_cat_all#17.week_from_opening_7_5_2 1.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Hybrid) mlcolor(black))   (change_bl_trad_nomm_all, keep(2.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Traditional) mlcolor(black)), yline(0, lcolor(black) lpattern(dash)) vertical rename(2.open1_mean_cat_all#1.week_from_opening_7_5_2 = 1.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 = 1.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 = 1.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 = 1.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 = 1.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 = 1.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 = 1.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 = 1.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 = 1.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 = 1.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 = 1.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 = 1.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 = 1.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 = 1.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 = 1.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 = 1.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 = 1.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2 = 1.open1_mean_cat_all#18.week_from_opening_7_5_2) coeflabels(1.open1_mean_cat_all#1.week_from_opening_7_5_2 = "-4" 1.open1_mean_cat_all#2.week_from_opening_7_5_2 = "-3" 1.open1_mean_cat_all#3.week_from_opening_7_5_2 = "-2" 1.open1_mean_cat_all#4.week_from_opening_7_5_2 = "-1" 1.open1_mean_cat_all#5.week_from_opening_7_5_2 = "0" 1.open1_mean_cat_all#6.week_from_opening_7_5_2 = "1" 1.open1_mean_cat_all#7.week_from_opening_7_5_2 = "2" 1.open1_mean_cat_all#8.week_from_opening_7_5_2 = "3" 1.open1_mean_cat_all#9.week_from_opening_7_5_2 = "4" 1.open1_mean_cat_all#10.week_from_opening_7_5_2 = "5" 1.open1_mean_cat_all#11.week_from_opening_7_5_2  = "6" 1.open1_mean_cat_all#12.week_from_opening_7_5_2 = "7" 1.open1_mean_cat_all#13.week_from_opening_7_5_2 = "8" 1.open1_mean_cat_all#14.week_from_opening_7_5_2 = "9" 1.open1_mean_cat_all#15.week_from_opening_7_5_2 = "10" 1.open1_mean_cat_all#16.week_from_opening_7_5_2 = "11" 1.open1_mean_cat_all#17.week_from_opening_7_5_2 = "12" 1.open1_mean_cat_all#18.week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)


graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Change from Baseline - No Mask Mandate 4 - 210406.gph", replace
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Change from Baseline - No Mask Mandate 4 - 210406.jpg", as(jpg) name("Graph") quality(100) replace







*WITH A MASK MANDATE
**NE
*running it once and saving the estimates as hybrid
reg cases_per_pop_bl_diff i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if h6_facialcoverings4_all == 1 & region == 0, vce(cluster fips)

estimates store change_bl_hybrid_mm_ne

*running it again and saving the estimates as traditional
reg cases_per_pop_bl_diff i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if h6_facialcoverings4_all == 1 & region == 0, vce(cluster fips)

estimates store change_bl_trad_mm_ne

**PLOTTING THE COEFFICIENTS*****
coefplot (change_bl_hybrid_mm_ne, keep(1.open1_mean_cat_all#1.week_from_opening_7_5_2 1.open1_mean_cat_all#2.week_from_opening_7_5_2 1.open1_mean_cat_all#3.week_from_opening_7_5_2 1.open1_mean_cat_all#4.week_from_opening_7_5_2 1.open1_mean_cat_all#5.week_from_opening_7_5_2 1.open1_mean_cat_all#6.week_from_opening_7_5_2 1.open1_mean_cat_all#7.week_from_opening_7_5_2 1.open1_mean_cat_all#8.week_from_opening_7_5_2 1.open1_mean_cat_all#9.week_from_opening_7_5_2 1.open1_mean_cat_all#10.week_from_opening_7_5_2 1.open1_mean_cat_all#11.week_from_opening_7_5_2 1.open1_mean_cat_all#12.week_from_opening_7_5_2 1.open1_mean_cat_all#13.week_from_opening_7_5_2 1.open1_mean_cat_all#14.week_from_opening_7_5_2 1.open1_mean_cat_all#15.week_from_opening_7_5_2 1.open1_mean_cat_all#16.week_from_opening_7_5_2 1.open1_mean_cat_all#17.week_from_opening_7_5_2 1.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Hybrid) mlcolor(black))   (change_bl_trad_mm_ne, keep(2.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Traditional) mlcolor(black)), yline(0, lcolor(black) lpattern(dash)) vertical rename(2.open1_mean_cat_all#1.week_from_opening_7_5_2 = 1.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 = 1.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 = 1.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 = 1.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 = 1.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 = 1.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 = 1.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 = 1.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 = 1.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 = 1.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 = 1.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 = 1.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 = 1.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 = 1.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 = 1.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 = 1.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 = 1.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2 = 1.open1_mean_cat_all#18.week_from_opening_7_5_2) coeflabels(1.open1_mean_cat_all#1.week_from_opening_7_5_2 = "-4" 1.open1_mean_cat_all#2.week_from_opening_7_5_2 = "-3" 1.open1_mean_cat_all#3.week_from_opening_7_5_2 = "-2" 1.open1_mean_cat_all#4.week_from_opening_7_5_2 = "-1" 1.open1_mean_cat_all#5.week_from_opening_7_5_2 = "0" 1.open1_mean_cat_all#6.week_from_opening_7_5_2 = "1" 1.open1_mean_cat_all#7.week_from_opening_7_5_2 = "2" 1.open1_mean_cat_all#8.week_from_opening_7_5_2 = "3" 1.open1_mean_cat_all#9.week_from_opening_7_5_2 = "4" 1.open1_mean_cat_all#10.week_from_opening_7_5_2 = "5" 1.open1_mean_cat_all#11.week_from_opening_7_5_2  = "6" 1.open1_mean_cat_all#12.week_from_opening_7_5_2 = "7" 1.open1_mean_cat_all#13.week_from_opening_7_5_2 = "8" 1.open1_mean_cat_all#14.week_from_opening_7_5_2 = "9" 1.open1_mean_cat_all#15.week_from_opening_7_5_2 = "10" 1.open1_mean_cat_all#16.week_from_opening_7_5_2 = "11" 1.open1_mean_cat_all#17.week_from_opening_7_5_2 = "12" 1.open1_mean_cat_all#18.week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)


graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Change from Baseline - Mask Mandate 4 - NE - 210406.gph", replace
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Change from Baseline - Mask Mandate 4 - NE - 210406.jpg", as(jpg) name("Graph") quality(100) replace



***WITHOUT MASK MANDATE 4
**NE
*running it once and saving the estimates as hybrid
reg cases_per_pop_bl_diff i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if h6_facialcoverings4_all == 0 & region == 0, vce(cluster fips)

estimates store change_bl_hybrid_nomm_ne

*running it again and saving the estimates as traditional
reg cases_per_pop_bl_diff i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if h6_facialcoverings4_all == 0 & region == 0, vce(cluster fips)

estimates store change_bl_trad_nomm_ne

**PLOTTING THE COEFFICIENTS*****
coefplot (change_bl_hybrid_nomm_ne, keep(1.open1_mean_cat_all#1.week_from_opening_7_5_2 1.open1_mean_cat_all#2.week_from_opening_7_5_2 1.open1_mean_cat_all#3.week_from_opening_7_5_2 1.open1_mean_cat_all#4.week_from_opening_7_5_2 1.open1_mean_cat_all#5.week_from_opening_7_5_2 1.open1_mean_cat_all#6.week_from_opening_7_5_2 1.open1_mean_cat_all#7.week_from_opening_7_5_2 1.open1_mean_cat_all#8.week_from_opening_7_5_2 1.open1_mean_cat_all#9.week_from_opening_7_5_2 1.open1_mean_cat_all#10.week_from_opening_7_5_2 1.open1_mean_cat_all#11.week_from_opening_7_5_2 1.open1_mean_cat_all#12.week_from_opening_7_5_2 1.open1_mean_cat_all#13.week_from_opening_7_5_2 1.open1_mean_cat_all#14.week_from_opening_7_5_2 1.open1_mean_cat_all#15.week_from_opening_7_5_2 1.open1_mean_cat_all#16.week_from_opening_7_5_2 1.open1_mean_cat_all#17.week_from_opening_7_5_2 1.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Hybrid) mlcolor(black))   (change_bl_trad_nomm_ne, keep(2.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Traditional) mlcolor(black)), yline(0, lcolor(black) lpattern(dash)) vertical rename(2.open1_mean_cat_all#1.week_from_opening_7_5_2 = 1.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 = 1.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 = 1.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 = 1.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 = 1.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 = 1.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 = 1.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 = 1.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 = 1.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 = 1.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 = 1.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 = 1.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 = 1.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 = 1.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 = 1.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 = 1.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 = 1.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2 = 1.open1_mean_cat_all#18.week_from_opening_7_5_2) coeflabels(1.open1_mean_cat_all#1.week_from_opening_7_5_2 = "-4" 1.open1_mean_cat_all#2.week_from_opening_7_5_2 = "-3" 1.open1_mean_cat_all#3.week_from_opening_7_5_2 = "-2" 1.open1_mean_cat_all#4.week_from_opening_7_5_2 = "-1" 1.open1_mean_cat_all#5.week_from_opening_7_5_2 = "0" 1.open1_mean_cat_all#6.week_from_opening_7_5_2 = "1" 1.open1_mean_cat_all#7.week_from_opening_7_5_2 = "2" 1.open1_mean_cat_all#8.week_from_opening_7_5_2 = "3" 1.open1_mean_cat_all#9.week_from_opening_7_5_2 = "4" 1.open1_mean_cat_all#10.week_from_opening_7_5_2 = "5" 1.open1_mean_cat_all#11.week_from_opening_7_5_2  = "6" 1.open1_mean_cat_all#12.week_from_opening_7_5_2 = "7" 1.open1_mean_cat_all#13.week_from_opening_7_5_2 = "8" 1.open1_mean_cat_all#14.week_from_opening_7_5_2 = "9" 1.open1_mean_cat_all#15.week_from_opening_7_5_2 = "10" 1.open1_mean_cat_all#16.week_from_opening_7_5_2 = "11" 1.open1_mean_cat_all#17.week_from_opening_7_5_2 = "12" 1.open1_mean_cat_all#18.week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)


graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Change from Baseline - No Mask Mandate 4 - NE - 210406.gph", replace
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Change from Baseline - No Mask Mandate 4 - NE - 210406.jpg", as(jpg) name("Graph") quality(100) replace






*WITH A MASK MANDATE
**W
*running it once and saving the estimates as hybrid
reg cases_per_pop_bl_diff i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if h6_facialcoverings4_all == 1 & region == 1, vce(cluster fips)

estimates store change_bl_hybrid_mm_w

*running it again and saving the estimates as traditional
reg cases_per_pop_bl_diff i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if h6_facialcoverings4_all == 1 & region == 1, vce(cluster fips)

estimates store change_bl_trad_mm_w

**PLOTTING THE COEFFICIENTS*****
coefplot (change_bl_hybrid_mm_w, keep(1.open1_mean_cat_all#1.week_from_opening_7_5_2 1.open1_mean_cat_all#2.week_from_opening_7_5_2 1.open1_mean_cat_all#3.week_from_opening_7_5_2 1.open1_mean_cat_all#4.week_from_opening_7_5_2 1.open1_mean_cat_all#5.week_from_opening_7_5_2 1.open1_mean_cat_all#6.week_from_opening_7_5_2 1.open1_mean_cat_all#7.week_from_opening_7_5_2 1.open1_mean_cat_all#8.week_from_opening_7_5_2 1.open1_mean_cat_all#9.week_from_opening_7_5_2 1.open1_mean_cat_all#10.week_from_opening_7_5_2 1.open1_mean_cat_all#11.week_from_opening_7_5_2 1.open1_mean_cat_all#12.week_from_opening_7_5_2 1.open1_mean_cat_all#13.week_from_opening_7_5_2 1.open1_mean_cat_all#14.week_from_opening_7_5_2 1.open1_mean_cat_all#15.week_from_opening_7_5_2 1.open1_mean_cat_all#16.week_from_opening_7_5_2 1.open1_mean_cat_all#17.week_from_opening_7_5_2 1.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Hybrid) mlcolor(black))   (change_bl_trad_mm_w, keep(2.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Traditional) mlcolor(black)), yline(0, lcolor(black) lpattern(dash)) vertical rename(2.open1_mean_cat_all#1.week_from_opening_7_5_2 = 1.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 = 1.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 = 1.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 = 1.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 = 1.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 = 1.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 = 1.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 = 1.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 = 1.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 = 1.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 = 1.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 = 1.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 = 1.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 = 1.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 = 1.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 = 1.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 = 1.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2 = 1.open1_mean_cat_all#18.week_from_opening_7_5_2) coeflabels(1.open1_mean_cat_all#1.week_from_opening_7_5_2 = "-4" 1.open1_mean_cat_all#2.week_from_opening_7_5_2 = "-3" 1.open1_mean_cat_all#3.week_from_opening_7_5_2 = "-2" 1.open1_mean_cat_all#4.week_from_opening_7_5_2 = "-1" 1.open1_mean_cat_all#5.week_from_opening_7_5_2 = "0" 1.open1_mean_cat_all#6.week_from_opening_7_5_2 = "1" 1.open1_mean_cat_all#7.week_from_opening_7_5_2 = "2" 1.open1_mean_cat_all#8.week_from_opening_7_5_2 = "3" 1.open1_mean_cat_all#9.week_from_opening_7_5_2 = "4" 1.open1_mean_cat_all#10.week_from_opening_7_5_2 = "5" 1.open1_mean_cat_all#11.week_from_opening_7_5_2  = "6" 1.open1_mean_cat_all#12.week_from_opening_7_5_2 = "7" 1.open1_mean_cat_all#13.week_from_opening_7_5_2 = "8" 1.open1_mean_cat_all#14.week_from_opening_7_5_2 = "9" 1.open1_mean_cat_all#15.week_from_opening_7_5_2 = "10" 1.open1_mean_cat_all#16.week_from_opening_7_5_2 = "11" 1.open1_mean_cat_all#17.week_from_opening_7_5_2 = "12" 1.open1_mean_cat_all#18.week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)


graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Change from Baseline - Mask Mandate 4 - W - 210406.gph", replace
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Change from Baseline - Mask Mandate 4 - W - 210406.jpg", as(jpg) name("Graph") quality(100) replace



***WITHOUT MASK MANDATE 4
**W
*running it once and saving the estimates as hybrid
reg cases_per_pop_bl_diff i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if h6_facialcoverings4_all == 0 & region == 1, vce(cluster fips)

estimates store change_bl_hybrid_nomm_w

*running it again and saving the estimates as traditional
reg cases_per_pop_bl_diff i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if h6_facialcoverings4_all == 0 & region == 1, vce(cluster fips)

estimates store change_bl_trad_nomm_w

**PLOTTING THE COEFFICIENTS*****
coefplot (change_bl_hybrid_nomm_w, keep(1.open1_mean_cat_all#1.week_from_opening_7_5_2 1.open1_mean_cat_all#2.week_from_opening_7_5_2 1.open1_mean_cat_all#3.week_from_opening_7_5_2 1.open1_mean_cat_all#4.week_from_opening_7_5_2 1.open1_mean_cat_all#5.week_from_opening_7_5_2 1.open1_mean_cat_all#6.week_from_opening_7_5_2 1.open1_mean_cat_all#7.week_from_opening_7_5_2 1.open1_mean_cat_all#8.week_from_opening_7_5_2 1.open1_mean_cat_all#9.week_from_opening_7_5_2 1.open1_mean_cat_all#10.week_from_opening_7_5_2 1.open1_mean_cat_all#11.week_from_opening_7_5_2 1.open1_mean_cat_all#12.week_from_opening_7_5_2 1.open1_mean_cat_all#13.week_from_opening_7_5_2 1.open1_mean_cat_all#14.week_from_opening_7_5_2 1.open1_mean_cat_all#15.week_from_opening_7_5_2 1.open1_mean_cat_all#16.week_from_opening_7_5_2 1.open1_mean_cat_all#17.week_from_opening_7_5_2 1.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Hybrid) mlcolor(black))   (change_bl_trad_nomm_w, keep(2.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Traditional) mlcolor(black)), yline(0, lcolor(black) lpattern(dash)) vertical rename(2.open1_mean_cat_all#1.week_from_opening_7_5_2 = 1.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 = 1.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 = 1.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 = 1.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 = 1.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 = 1.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 = 1.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 = 1.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 = 1.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 = 1.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 = 1.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 = 1.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 = 1.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 = 1.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 = 1.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 = 1.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 = 1.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2 = 1.open1_mean_cat_all#18.week_from_opening_7_5_2) coeflabels(1.open1_mean_cat_all#1.week_from_opening_7_5_2 = "-4" 1.open1_mean_cat_all#2.week_from_opening_7_5_2 = "-3" 1.open1_mean_cat_all#3.week_from_opening_7_5_2 = "-2" 1.open1_mean_cat_all#4.week_from_opening_7_5_2 = "-1" 1.open1_mean_cat_all#5.week_from_opening_7_5_2 = "0" 1.open1_mean_cat_all#6.week_from_opening_7_5_2 = "1" 1.open1_mean_cat_all#7.week_from_opening_7_5_2 = "2" 1.open1_mean_cat_all#8.week_from_opening_7_5_2 = "3" 1.open1_mean_cat_all#9.week_from_opening_7_5_2 = "4" 1.open1_mean_cat_all#10.week_from_opening_7_5_2 = "5" 1.open1_mean_cat_all#11.week_from_opening_7_5_2  = "6" 1.open1_mean_cat_all#12.week_from_opening_7_5_2 = "7" 1.open1_mean_cat_all#13.week_from_opening_7_5_2 = "8" 1.open1_mean_cat_all#14.week_from_opening_7_5_2 = "9" 1.open1_mean_cat_all#15.week_from_opening_7_5_2 = "10" 1.open1_mean_cat_all#16.week_from_opening_7_5_2 = "11" 1.open1_mean_cat_all#17.week_from_opening_7_5_2 = "12" 1.open1_mean_cat_all#18.week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)


graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Change from Baseline - No Mask Mandate 4 - W - 210406.gph", replace
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Change from Baseline - No Mask Mandate 4 - W - 210406.jpg", as(jpg) name("Graph") quality(100) replace







*WITH A MASK MANDATE
**MW
*running it once and saving the estimates as hybrid
reg cases_per_pop_bl_diff i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if h6_facialcoverings4_all == 1 & region == 2, vce(cluster fips)

estimates store change_bl_hybrid_mm_mw

*running it again and saving the estimates as traditional
reg cases_per_pop_bl_diff i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if h6_facialcoverings4_all == 1 & region == 2, vce(cluster fips)

estimates store change_bl_trad_mm_mw

**PLOTTING THE COEFFICIENTS*****
coefplot (change_bl_hybrid_mm_mw, keep(1.open1_mean_cat_all#1.week_from_opening_7_5_2 1.open1_mean_cat_all#2.week_from_opening_7_5_2 1.open1_mean_cat_all#3.week_from_opening_7_5_2 1.open1_mean_cat_all#4.week_from_opening_7_5_2 1.open1_mean_cat_all#5.week_from_opening_7_5_2 1.open1_mean_cat_all#6.week_from_opening_7_5_2 1.open1_mean_cat_all#7.week_from_opening_7_5_2 1.open1_mean_cat_all#8.week_from_opening_7_5_2 1.open1_mean_cat_all#9.week_from_opening_7_5_2 1.open1_mean_cat_all#10.week_from_opening_7_5_2 1.open1_mean_cat_all#11.week_from_opening_7_5_2 1.open1_mean_cat_all#12.week_from_opening_7_5_2 1.open1_mean_cat_all#13.week_from_opening_7_5_2 1.open1_mean_cat_all#14.week_from_opening_7_5_2 1.open1_mean_cat_all#15.week_from_opening_7_5_2 1.open1_mean_cat_all#16.week_from_opening_7_5_2 1.open1_mean_cat_all#17.week_from_opening_7_5_2 1.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Hybrid) mlcolor(black))   (change_bl_trad_mm_mw, keep(2.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Traditional) mlcolor(black)), yline(0, lcolor(black) lpattern(dash)) vertical rename(2.open1_mean_cat_all#1.week_from_opening_7_5_2 = 1.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 = 1.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 = 1.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 = 1.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 = 1.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 = 1.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 = 1.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 = 1.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 = 1.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 = 1.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 = 1.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 = 1.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 = 1.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 = 1.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 = 1.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 = 1.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 = 1.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2 = 1.open1_mean_cat_all#18.week_from_opening_7_5_2) coeflabels(1.open1_mean_cat_all#1.week_from_opening_7_5_2 = "-4" 1.open1_mean_cat_all#2.week_from_opening_7_5_2 = "-3" 1.open1_mean_cat_all#3.week_from_opening_7_5_2 = "-2" 1.open1_mean_cat_all#4.week_from_opening_7_5_2 = "-1" 1.open1_mean_cat_all#5.week_from_opening_7_5_2 = "0" 1.open1_mean_cat_all#6.week_from_opening_7_5_2 = "1" 1.open1_mean_cat_all#7.week_from_opening_7_5_2 = "2" 1.open1_mean_cat_all#8.week_from_opening_7_5_2 = "3" 1.open1_mean_cat_all#9.week_from_opening_7_5_2 = "4" 1.open1_mean_cat_all#10.week_from_opening_7_5_2 = "5" 1.open1_mean_cat_all#11.week_from_opening_7_5_2  = "6" 1.open1_mean_cat_all#12.week_from_opening_7_5_2 = "7" 1.open1_mean_cat_all#13.week_from_opening_7_5_2 = "8" 1.open1_mean_cat_all#14.week_from_opening_7_5_2 = "9" 1.open1_mean_cat_all#15.week_from_opening_7_5_2 = "10" 1.open1_mean_cat_all#16.week_from_opening_7_5_2 = "11" 1.open1_mean_cat_all#17.week_from_opening_7_5_2 = "12" 1.open1_mean_cat_all#18.week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)


graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Change from Baseline - Mask Mandate 4 - MW - 210406.gph", replace
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Change from Baseline - Mask Mandate 4 - MW - 210406.jpg", as(jpg) name("Graph") quality(100) replace



***WITHOUT MASK MANDATE 4
**MW
*running it once and saving the estimates as hybrid
reg cases_per_pop_bl_diff i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if h6_facialcoverings4_all == 0 & region == 2, vce(cluster fips)

estimates store change_bl_hybrid_nomm_mw

*running it again and saving the estimates as traditional
reg cases_per_pop_bl_diff i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if h6_facialcoverings4_all == 0 & region == 2, vce(cluster fips)

estimates store change_bl_trad_nomm_mw

**PLOTTING THE COEFFICIENTS*****
coefplot (change_bl_hybrid_nomm_mw, keep(1.open1_mean_cat_all#1.week_from_opening_7_5_2 1.open1_mean_cat_all#2.week_from_opening_7_5_2 1.open1_mean_cat_all#3.week_from_opening_7_5_2 1.open1_mean_cat_all#4.week_from_opening_7_5_2 1.open1_mean_cat_all#5.week_from_opening_7_5_2 1.open1_mean_cat_all#6.week_from_opening_7_5_2 1.open1_mean_cat_all#7.week_from_opening_7_5_2 1.open1_mean_cat_all#8.week_from_opening_7_5_2 1.open1_mean_cat_all#9.week_from_opening_7_5_2 1.open1_mean_cat_all#10.week_from_opening_7_5_2 1.open1_mean_cat_all#11.week_from_opening_7_5_2 1.open1_mean_cat_all#12.week_from_opening_7_5_2 1.open1_mean_cat_all#13.week_from_opening_7_5_2 1.open1_mean_cat_all#14.week_from_opening_7_5_2 1.open1_mean_cat_all#15.week_from_opening_7_5_2 1.open1_mean_cat_all#16.week_from_opening_7_5_2 1.open1_mean_cat_all#17.week_from_opening_7_5_2 1.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Hybrid) mlcolor(black))   (change_bl_trad_nomm_mw, keep(2.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Traditional) mlcolor(black)), yline(0, lcolor(black) lpattern(dash)) vertical rename(2.open1_mean_cat_all#1.week_from_opening_7_5_2 = 1.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 = 1.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 = 1.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 = 1.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 = 1.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 = 1.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 = 1.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 = 1.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 = 1.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 = 1.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 = 1.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 = 1.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 = 1.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 = 1.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 = 1.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 = 1.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 = 1.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2 = 1.open1_mean_cat_all#18.week_from_opening_7_5_2) coeflabels(1.open1_mean_cat_all#1.week_from_opening_7_5_2 = "-4" 1.open1_mean_cat_all#2.week_from_opening_7_5_2 = "-3" 1.open1_mean_cat_all#3.week_from_opening_7_5_2 = "-2" 1.open1_mean_cat_all#4.week_from_opening_7_5_2 = "-1" 1.open1_mean_cat_all#5.week_from_opening_7_5_2 = "0" 1.open1_mean_cat_all#6.week_from_opening_7_5_2 = "1" 1.open1_mean_cat_all#7.week_from_opening_7_5_2 = "2" 1.open1_mean_cat_all#8.week_from_opening_7_5_2 = "3" 1.open1_mean_cat_all#9.week_from_opening_7_5_2 = "4" 1.open1_mean_cat_all#10.week_from_opening_7_5_2 = "5" 1.open1_mean_cat_all#11.week_from_opening_7_5_2  = "6" 1.open1_mean_cat_all#12.week_from_opening_7_5_2 = "7" 1.open1_mean_cat_all#13.week_from_opening_7_5_2 = "8" 1.open1_mean_cat_all#14.week_from_opening_7_5_2 = "9" 1.open1_mean_cat_all#15.week_from_opening_7_5_2 = "10" 1.open1_mean_cat_all#16.week_from_opening_7_5_2 = "11" 1.open1_mean_cat_all#17.week_from_opening_7_5_2 = "12" 1.open1_mean_cat_all#18.week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)


graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Change from Baseline - No Mask Mandate 4 - MW - 210406.gph", replace
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Change from Baseline - No Mask Mandate 4 - MW - 210406.jpg", as(jpg) name("Graph") quality(100) replace








*WITH A MASK MANDATE
**S
*running it once and saving the estimates as hybrid
reg cases_per_pop_bl_diff i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if h6_facialcoverings4_all == 1 & region == 3, vce(cluster fips)

estimates store change_bl_hybrid_mm_s

*running it again and saving the estimates as traditional
reg cases_per_pop_bl_diff i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if h6_facialcoverings4_all == 1 & region == 3, vce(cluster fips)

estimates store change_bl_trad_mm_s

**PLOTTING THE COEFFICIENTS*****
coefplot (change_bl_hybrid_mm_s, keep(1.open1_mean_cat_all#1.week_from_opening_7_5_2 1.open1_mean_cat_all#2.week_from_opening_7_5_2 1.open1_mean_cat_all#3.week_from_opening_7_5_2 1.open1_mean_cat_all#4.week_from_opening_7_5_2 1.open1_mean_cat_all#5.week_from_opening_7_5_2 1.open1_mean_cat_all#6.week_from_opening_7_5_2 1.open1_mean_cat_all#7.week_from_opening_7_5_2 1.open1_mean_cat_all#8.week_from_opening_7_5_2 1.open1_mean_cat_all#9.week_from_opening_7_5_2 1.open1_mean_cat_all#10.week_from_opening_7_5_2 1.open1_mean_cat_all#11.week_from_opening_7_5_2 1.open1_mean_cat_all#12.week_from_opening_7_5_2 1.open1_mean_cat_all#13.week_from_opening_7_5_2 1.open1_mean_cat_all#14.week_from_opening_7_5_2 1.open1_mean_cat_all#15.week_from_opening_7_5_2 1.open1_mean_cat_all#16.week_from_opening_7_5_2 1.open1_mean_cat_all#17.week_from_opening_7_5_2 1.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Hybrid) mlcolor(black))   (change_bl_trad_mm_s, keep(2.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Traditional) mlcolor(black)), yline(0, lcolor(black) lpattern(dash)) vertical rename(2.open1_mean_cat_all#1.week_from_opening_7_5_2 = 1.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 = 1.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 = 1.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 = 1.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 = 1.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 = 1.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 = 1.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 = 1.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 = 1.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 = 1.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 = 1.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 = 1.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 = 1.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 = 1.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 = 1.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 = 1.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 = 1.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2 = 1.open1_mean_cat_all#18.week_from_opening_7_5_2) coeflabels(1.open1_mean_cat_all#1.week_from_opening_7_5_2 = "-4" 1.open1_mean_cat_all#2.week_from_opening_7_5_2 = "-3" 1.open1_mean_cat_all#3.week_from_opening_7_5_2 = "-2" 1.open1_mean_cat_all#4.week_from_opening_7_5_2 = "-1" 1.open1_mean_cat_all#5.week_from_opening_7_5_2 = "0" 1.open1_mean_cat_all#6.week_from_opening_7_5_2 = "1" 1.open1_mean_cat_all#7.week_from_opening_7_5_2 = "2" 1.open1_mean_cat_all#8.week_from_opening_7_5_2 = "3" 1.open1_mean_cat_all#9.week_from_opening_7_5_2 = "4" 1.open1_mean_cat_all#10.week_from_opening_7_5_2 = "5" 1.open1_mean_cat_all#11.week_from_opening_7_5_2  = "6" 1.open1_mean_cat_all#12.week_from_opening_7_5_2 = "7" 1.open1_mean_cat_all#13.week_from_opening_7_5_2 = "8" 1.open1_mean_cat_all#14.week_from_opening_7_5_2 = "9" 1.open1_mean_cat_all#15.week_from_opening_7_5_2 = "10" 1.open1_mean_cat_all#16.week_from_opening_7_5_2 = "11" 1.open1_mean_cat_all#17.week_from_opening_7_5_2 = "12" 1.open1_mean_cat_all#18.week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)


graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Change from Baseline - Mask Mandate 4 - S - 210406.gph", replace
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Change from Baseline - Mask Mandate 4 - S - 210406.jpg", as(jpg) name("Graph") quality(100) replace



***WITHOUT MASK MANDATE 4
**MW
*running it once and saving the estimates as hybrid
reg cases_per_pop_bl_diff i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if h6_facialcoverings4_all == 0 & region == 3, vce(cluster fips)

estimates store change_bl_hybrid_nomm_s

*running it again and saving the estimates as traditional
reg cases_per_pop_bl_diff i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if h6_facialcoverings4_all == 0 & region == 3, vce(cluster fips)

estimates store change_bl_trad_nomm_s

**PLOTTING THE COEFFICIENTS*****
coefplot (change_bl_hybrid_nomm_s, keep(1.open1_mean_cat_all#1.week_from_opening_7_5_2 1.open1_mean_cat_all#2.week_from_opening_7_5_2 1.open1_mean_cat_all#3.week_from_opening_7_5_2 1.open1_mean_cat_all#4.week_from_opening_7_5_2 1.open1_mean_cat_all#5.week_from_opening_7_5_2 1.open1_mean_cat_all#6.week_from_opening_7_5_2 1.open1_mean_cat_all#7.week_from_opening_7_5_2 1.open1_mean_cat_all#8.week_from_opening_7_5_2 1.open1_mean_cat_all#9.week_from_opening_7_5_2 1.open1_mean_cat_all#10.week_from_opening_7_5_2 1.open1_mean_cat_all#11.week_from_opening_7_5_2 1.open1_mean_cat_all#12.week_from_opening_7_5_2 1.open1_mean_cat_all#13.week_from_opening_7_5_2 1.open1_mean_cat_all#14.week_from_opening_7_5_2 1.open1_mean_cat_all#15.week_from_opening_7_5_2 1.open1_mean_cat_all#16.week_from_opening_7_5_2 1.open1_mean_cat_all#17.week_from_opening_7_5_2 1.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Hybrid) mlcolor(black))   (change_bl_trad_nomm_s, keep(2.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Traditional) mlcolor(black)), yline(0, lcolor(black) lpattern(dash)) vertical rename(2.open1_mean_cat_all#1.week_from_opening_7_5_2 = 1.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 = 1.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 = 1.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 = 1.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 = 1.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 = 1.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 = 1.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 = 1.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 = 1.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 = 1.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 = 1.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 = 1.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 = 1.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 = 1.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 = 1.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 = 1.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 = 1.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2 = 1.open1_mean_cat_all#18.week_from_opening_7_5_2) coeflabels(1.open1_mean_cat_all#1.week_from_opening_7_5_2 = "-4" 1.open1_mean_cat_all#2.week_from_opening_7_5_2 = "-3" 1.open1_mean_cat_all#3.week_from_opening_7_5_2 = "-2" 1.open1_mean_cat_all#4.week_from_opening_7_5_2 = "-1" 1.open1_mean_cat_all#5.week_from_opening_7_5_2 = "0" 1.open1_mean_cat_all#6.week_from_opening_7_5_2 = "1" 1.open1_mean_cat_all#7.week_from_opening_7_5_2 = "2" 1.open1_mean_cat_all#8.week_from_opening_7_5_2 = "3" 1.open1_mean_cat_all#9.week_from_opening_7_5_2 = "4" 1.open1_mean_cat_all#10.week_from_opening_7_5_2 = "5" 1.open1_mean_cat_all#11.week_from_opening_7_5_2  = "6" 1.open1_mean_cat_all#12.week_from_opening_7_5_2 = "7" 1.open1_mean_cat_all#13.week_from_opening_7_5_2 = "8" 1.open1_mean_cat_all#14.week_from_opening_7_5_2 = "9" 1.open1_mean_cat_all#15.week_from_opening_7_5_2 = "10" 1.open1_mean_cat_all#16.week_from_opening_7_5_2 = "11" 1.open1_mean_cat_all#17.week_from_opening_7_5_2 = "12" 1.open1_mean_cat_all#18.week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)


graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Change from Baseline - No Mask Mandate 4 - S - 210406.gph", replace
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Change from Baseline - No Mask Mandate 4 - S - 210406.jpg", as(jpg) name("Graph") quality(100) replace







****CHANGE FROM BASELINE***
****MASK MANDATE 3&4********
*****************************


**WITH MASK MANDATE
**overall
*running it once and saving the estimates as hybrid
reg cases_per_pop_bl_diff i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if h6_facialcoverings34_all == 1, vce(cluster fips)

estimates store change_bl_hybrid_mm34_overall

*running it again and saving the estimates as traditional
reg cases_per_pop_bl_diff i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if h6_facialcoverings4_all == 1, vce(cluster fips)

estimates store change_bl_trad_mm34_overall

**PLOTTING THE COEFFICIENTS*****
coefplot (change_bl_hybrid_mm34_overall, keep(1.open1_mean_cat_all#1.week_from_opening_7_5_2 1.open1_mean_cat_all#2.week_from_opening_7_5_2 1.open1_mean_cat_all#3.week_from_opening_7_5_2 1.open1_mean_cat_all#4.week_from_opening_7_5_2 1.open1_mean_cat_all#5.week_from_opening_7_5_2 1.open1_mean_cat_all#6.week_from_opening_7_5_2 1.open1_mean_cat_all#7.week_from_opening_7_5_2 1.open1_mean_cat_all#8.week_from_opening_7_5_2 1.open1_mean_cat_all#9.week_from_opening_7_5_2 1.open1_mean_cat_all#10.week_from_opening_7_5_2 1.open1_mean_cat_all#11.week_from_opening_7_5_2 1.open1_mean_cat_all#12.week_from_opening_7_5_2 1.open1_mean_cat_all#13.week_from_opening_7_5_2 1.open1_mean_cat_all#14.week_from_opening_7_5_2 1.open1_mean_cat_all#15.week_from_opening_7_5_2 1.open1_mean_cat_all#16.week_from_opening_7_5_2 1.open1_mean_cat_all#17.week_from_opening_7_5_2 1.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Hybrid) mlcolor(black))   (change_bl_trad_mm34_overall, keep(2.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Traditional) mlcolor(black)), yline(0, lcolor(black) lpattern(dash)) vertical rename(2.open1_mean_cat_all#1.week_from_opening_7_5_2 = 1.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 = 1.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 = 1.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 = 1.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 = 1.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 = 1.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 = 1.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 = 1.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 = 1.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 = 1.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 = 1.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 = 1.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 = 1.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 = 1.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 = 1.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 = 1.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 = 1.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2 = 1.open1_mean_cat_all#18.week_from_opening_7_5_2) coeflabels(1.open1_mean_cat_all#1.week_from_opening_7_5_2 = "-4" 1.open1_mean_cat_all#2.week_from_opening_7_5_2 = "-3" 1.open1_mean_cat_all#3.week_from_opening_7_5_2 = "-2" 1.open1_mean_cat_all#4.week_from_opening_7_5_2 = "-1" 1.open1_mean_cat_all#5.week_from_opening_7_5_2 = "0" 1.open1_mean_cat_all#6.week_from_opening_7_5_2 = "1" 1.open1_mean_cat_all#7.week_from_opening_7_5_2 = "2" 1.open1_mean_cat_all#8.week_from_opening_7_5_2 = "3" 1.open1_mean_cat_all#9.week_from_opening_7_5_2 = "4" 1.open1_mean_cat_all#10.week_from_opening_7_5_2 = "5" 1.open1_mean_cat_all#11.week_from_opening_7_5_2  = "6" 1.open1_mean_cat_all#12.week_from_opening_7_5_2 = "7" 1.open1_mean_cat_all#13.week_from_opening_7_5_2 = "8" 1.open1_mean_cat_all#14.week_from_opening_7_5_2 = "9" 1.open1_mean_cat_all#15.week_from_opening_7_5_2 = "10" 1.open1_mean_cat_all#16.week_from_opening_7_5_2 = "11" 1.open1_mean_cat_all#17.week_from_opening_7_5_2 = "12" 1.open1_mean_cat_all#18.week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)


graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Change from Baseline - Mask Mandate 3&4 - 210406.gph", replace
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Change from Baseline - Mask Mandate 3&4 - 210406.jpg", as(jpg) name("Graph") quality(100) replace



***WITHOUT MASK MANDATE 3&4
**overall
*running it once and saving the estimates as hybrid
reg cases_per_pop_bl_diff i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if h6_facialcoverings34_all == 0, vce(cluster fips)

estimates store change_bl_hybrid_nomm34_all

*running it again and saving the estimates as traditional
reg cases_per_pop_bl_diff i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if h6_facialcoverings34_all == 0, vce(cluster fips)

estimates store change_bl_trad_nomm34_all

**PLOTTING THE COEFFICIENTS*****
coefplot (change_bl_hybrid_nomm34_all, keep(1.open1_mean_cat_all#1.week_from_opening_7_5_2 1.open1_mean_cat_all#2.week_from_opening_7_5_2 1.open1_mean_cat_all#3.week_from_opening_7_5_2 1.open1_mean_cat_all#4.week_from_opening_7_5_2 1.open1_mean_cat_all#5.week_from_opening_7_5_2 1.open1_mean_cat_all#6.week_from_opening_7_5_2 1.open1_mean_cat_all#7.week_from_opening_7_5_2 1.open1_mean_cat_all#8.week_from_opening_7_5_2 1.open1_mean_cat_all#9.week_from_opening_7_5_2 1.open1_mean_cat_all#10.week_from_opening_7_5_2 1.open1_mean_cat_all#11.week_from_opening_7_5_2 1.open1_mean_cat_all#12.week_from_opening_7_5_2 1.open1_mean_cat_all#13.week_from_opening_7_5_2 1.open1_mean_cat_all#14.week_from_opening_7_5_2 1.open1_mean_cat_all#15.week_from_opening_7_5_2 1.open1_mean_cat_all#16.week_from_opening_7_5_2 1.open1_mean_cat_all#17.week_from_opening_7_5_2 1.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Hybrid) mlcolor(black))   (change_bl_trad_nomm34_all, keep(2.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Traditional) mlcolor(black)), yline(0, lcolor(black) lpattern(dash)) vertical rename(2.open1_mean_cat_all#1.week_from_opening_7_5_2 = 1.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 = 1.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 = 1.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 = 1.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 = 1.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 = 1.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 = 1.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 = 1.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 = 1.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 = 1.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 = 1.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 = 1.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 = 1.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 = 1.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 = 1.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 = 1.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 = 1.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2 = 1.open1_mean_cat_all#18.week_from_opening_7_5_2) coeflabels(1.open1_mean_cat_all#1.week_from_opening_7_5_2 = "-4" 1.open1_mean_cat_all#2.week_from_opening_7_5_2 = "-3" 1.open1_mean_cat_all#3.week_from_opening_7_5_2 = "-2" 1.open1_mean_cat_all#4.week_from_opening_7_5_2 = "-1" 1.open1_mean_cat_all#5.week_from_opening_7_5_2 = "0" 1.open1_mean_cat_all#6.week_from_opening_7_5_2 = "1" 1.open1_mean_cat_all#7.week_from_opening_7_5_2 = "2" 1.open1_mean_cat_all#8.week_from_opening_7_5_2 = "3" 1.open1_mean_cat_all#9.week_from_opening_7_5_2 = "4" 1.open1_mean_cat_all#10.week_from_opening_7_5_2 = "5" 1.open1_mean_cat_all#11.week_from_opening_7_5_2  = "6" 1.open1_mean_cat_all#12.week_from_opening_7_5_2 = "7" 1.open1_mean_cat_all#13.week_from_opening_7_5_2 = "8" 1.open1_mean_cat_all#14.week_from_opening_7_5_2 = "9" 1.open1_mean_cat_all#15.week_from_opening_7_5_2 = "10" 1.open1_mean_cat_all#16.week_from_opening_7_5_2 = "11" 1.open1_mean_cat_all#17.week_from_opening_7_5_2 = "12" 1.open1_mean_cat_all#18.week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)


graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Change from Baseline - No Mask Mandate 3&4 - 210406.gph", replace
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Change from Baseline - No Mask Mandate 3&4 - 210406.jpg", as(jpg) name("Graph") quality(100) replace







*WITH A MASK MANDATE
**NE
*running it once and saving the estimates as hybrid
reg cases_per_pop_bl_diff i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if h6_facialcoverings34_all == 1 & region == 0, vce(cluster fips)

estimates store change_bl_hybrid_mm34_ne

*running it again and saving the estimates as traditional
reg cases_per_pop_bl_diff i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if h6_facialcoverings34_all == 1 & region == 0, vce(cluster fips)

estimates store change_bl_trad_mm34_ne

**PLOTTING THE COEFFICIENTS*****
coefplot (change_bl_hybrid_mm34_ne, keep(1.open1_mean_cat_all#1.week_from_opening_7_5_2 1.open1_mean_cat_all#2.week_from_opening_7_5_2 1.open1_mean_cat_all#3.week_from_opening_7_5_2 1.open1_mean_cat_all#4.week_from_opening_7_5_2 1.open1_mean_cat_all#5.week_from_opening_7_5_2 1.open1_mean_cat_all#6.week_from_opening_7_5_2 1.open1_mean_cat_all#7.week_from_opening_7_5_2 1.open1_mean_cat_all#8.week_from_opening_7_5_2 1.open1_mean_cat_all#9.week_from_opening_7_5_2 1.open1_mean_cat_all#10.week_from_opening_7_5_2 1.open1_mean_cat_all#11.week_from_opening_7_5_2 1.open1_mean_cat_all#12.week_from_opening_7_5_2 1.open1_mean_cat_all#13.week_from_opening_7_5_2 1.open1_mean_cat_all#14.week_from_opening_7_5_2 1.open1_mean_cat_all#15.week_from_opening_7_5_2 1.open1_mean_cat_all#16.week_from_opening_7_5_2 1.open1_mean_cat_all#17.week_from_opening_7_5_2 1.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Hybrid) mlcolor(black))   (change_bl_trad_mm34_ne, keep(2.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Traditional) mlcolor(black)), yline(0, lcolor(black) lpattern(dash)) vertical rename(2.open1_mean_cat_all#1.week_from_opening_7_5_2 = 1.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 = 1.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 = 1.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 = 1.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 = 1.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 = 1.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 = 1.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 = 1.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 = 1.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 = 1.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 = 1.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 = 1.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 = 1.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 = 1.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 = 1.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 = 1.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 = 1.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2 = 1.open1_mean_cat_all#18.week_from_opening_7_5_2) coeflabels(1.open1_mean_cat_all#1.week_from_opening_7_5_2 = "-4" 1.open1_mean_cat_all#2.week_from_opening_7_5_2 = "-3" 1.open1_mean_cat_all#3.week_from_opening_7_5_2 = "-2" 1.open1_mean_cat_all#4.week_from_opening_7_5_2 = "-1" 1.open1_mean_cat_all#5.week_from_opening_7_5_2 = "0" 1.open1_mean_cat_all#6.week_from_opening_7_5_2 = "1" 1.open1_mean_cat_all#7.week_from_opening_7_5_2 = "2" 1.open1_mean_cat_all#8.week_from_opening_7_5_2 = "3" 1.open1_mean_cat_all#9.week_from_opening_7_5_2 = "4" 1.open1_mean_cat_all#10.week_from_opening_7_5_2 = "5" 1.open1_mean_cat_all#11.week_from_opening_7_5_2  = "6" 1.open1_mean_cat_all#12.week_from_opening_7_5_2 = "7" 1.open1_mean_cat_all#13.week_from_opening_7_5_2 = "8" 1.open1_mean_cat_all#14.week_from_opening_7_5_2 = "9" 1.open1_mean_cat_all#15.week_from_opening_7_5_2 = "10" 1.open1_mean_cat_all#16.week_from_opening_7_5_2 = "11" 1.open1_mean_cat_all#17.week_from_opening_7_5_2 = "12" 1.open1_mean_cat_all#18.week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)


graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Change from Baseline - Mask Mandate 3&4 - NE - 210406.gph", replace
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Change from Baseline - Mask Mandate 3&4 - NE - 210406.jpg", as(jpg) name("Graph") quality(100) replace



***WITHOUT MASK MANDATE 3&4
**NE
*running it once and saving the estimates as hybrid
reg cases_per_pop_bl_diff i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if h6_facialcoverings34_all == 0 & region == 0, vce(cluster fips)

estimates store change_bl_hybrid_nomm34_ne

*running it again and saving the estimates as traditional
reg cases_per_pop_bl_diff i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if h6_facialcoverings34_all == 0 & region == 0, vce(cluster fips)

estimates store change_bl_trad_nomm34_ne

**PLOTTING THE COEFFICIENTS*****
coefplot (change_bl_hybrid_nomm34_ne, keep(1.open1_mean_cat_all#1.week_from_opening_7_5_2 1.open1_mean_cat_all#2.week_from_opening_7_5_2 1.open1_mean_cat_all#3.week_from_opening_7_5_2 1.open1_mean_cat_all#4.week_from_opening_7_5_2 1.open1_mean_cat_all#5.week_from_opening_7_5_2 1.open1_mean_cat_all#6.week_from_opening_7_5_2 1.open1_mean_cat_all#7.week_from_opening_7_5_2 1.open1_mean_cat_all#8.week_from_opening_7_5_2 1.open1_mean_cat_all#9.week_from_opening_7_5_2 1.open1_mean_cat_all#10.week_from_opening_7_5_2 1.open1_mean_cat_all#11.week_from_opening_7_5_2 1.open1_mean_cat_all#12.week_from_opening_7_5_2 1.open1_mean_cat_all#13.week_from_opening_7_5_2 1.open1_mean_cat_all#14.week_from_opening_7_5_2 1.open1_mean_cat_all#15.week_from_opening_7_5_2 1.open1_mean_cat_all#16.week_from_opening_7_5_2 1.open1_mean_cat_all#17.week_from_opening_7_5_2 1.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Hybrid) mlcolor(black))   (change_bl_trad_nomm34_ne, keep(2.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Traditional) mlcolor(black)), yline(0, lcolor(black) lpattern(dash)) vertical rename(2.open1_mean_cat_all#1.week_from_opening_7_5_2 = 1.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 = 1.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 = 1.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 = 1.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 = 1.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 = 1.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 = 1.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 = 1.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 = 1.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 = 1.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 = 1.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 = 1.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 = 1.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 = 1.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 = 1.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 = 1.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 = 1.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2 = 1.open1_mean_cat_all#18.week_from_opening_7_5_2) coeflabels(1.open1_mean_cat_all#1.week_from_opening_7_5_2 = "-4" 1.open1_mean_cat_all#2.week_from_opening_7_5_2 = "-3" 1.open1_mean_cat_all#3.week_from_opening_7_5_2 = "-2" 1.open1_mean_cat_all#4.week_from_opening_7_5_2 = "-1" 1.open1_mean_cat_all#5.week_from_opening_7_5_2 = "0" 1.open1_mean_cat_all#6.week_from_opening_7_5_2 = "1" 1.open1_mean_cat_all#7.week_from_opening_7_5_2 = "2" 1.open1_mean_cat_all#8.week_from_opening_7_5_2 = "3" 1.open1_mean_cat_all#9.week_from_opening_7_5_2 = "4" 1.open1_mean_cat_all#10.week_from_opening_7_5_2 = "5" 1.open1_mean_cat_all#11.week_from_opening_7_5_2  = "6" 1.open1_mean_cat_all#12.week_from_opening_7_5_2 = "7" 1.open1_mean_cat_all#13.week_from_opening_7_5_2 = "8" 1.open1_mean_cat_all#14.week_from_opening_7_5_2 = "9" 1.open1_mean_cat_all#15.week_from_opening_7_5_2 = "10" 1.open1_mean_cat_all#16.week_from_opening_7_5_2 = "11" 1.open1_mean_cat_all#17.week_from_opening_7_5_2 = "12" 1.open1_mean_cat_all#18.week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)


graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Change from Baseline - No Mask Mandate 3&4 - NE - 210406.gph", replace
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Change from Baseline - No Mask Mandate 3&4 - NE - 210406.jpg", as(jpg) name("Graph") quality(100) replace






*WITH A MASK MANDATE
**W
*running it once and saving the estimates as hybrid
reg cases_per_pop_bl_diff i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if h6_facialcoverings34_all == 1 & region == 1, vce(cluster fips)

estimates store change_bl_hybrid_mm34_w

*running it again and saving the estimates as traditional
reg cases_per_pop_bl_diff i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if h6_facialcoverings34_all == 1 & region == 1, vce(cluster fips)

estimates store change_bl_trad_mm34_w

**PLOTTING THE COEFFICIENTS*****
coefplot (change_bl_hybrid_mm34_w, keep(1.open1_mean_cat_all#1.week_from_opening_7_5_2 1.open1_mean_cat_all#2.week_from_opening_7_5_2 1.open1_mean_cat_all#3.week_from_opening_7_5_2 1.open1_mean_cat_all#4.week_from_opening_7_5_2 1.open1_mean_cat_all#5.week_from_opening_7_5_2 1.open1_mean_cat_all#6.week_from_opening_7_5_2 1.open1_mean_cat_all#7.week_from_opening_7_5_2 1.open1_mean_cat_all#8.week_from_opening_7_5_2 1.open1_mean_cat_all#9.week_from_opening_7_5_2 1.open1_mean_cat_all#10.week_from_opening_7_5_2 1.open1_mean_cat_all#11.week_from_opening_7_5_2 1.open1_mean_cat_all#12.week_from_opening_7_5_2 1.open1_mean_cat_all#13.week_from_opening_7_5_2 1.open1_mean_cat_all#14.week_from_opening_7_5_2 1.open1_mean_cat_all#15.week_from_opening_7_5_2 1.open1_mean_cat_all#16.week_from_opening_7_5_2 1.open1_mean_cat_all#17.week_from_opening_7_5_2 1.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Hybrid) mlcolor(black))   (change_bl_trad_mm34_w, keep(2.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Traditional) mlcolor(black)), yline(0, lcolor(black) lpattern(dash)) vertical rename(2.open1_mean_cat_all#1.week_from_opening_7_5_2 = 1.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 = 1.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 = 1.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 = 1.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 = 1.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 = 1.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 = 1.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 = 1.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 = 1.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 = 1.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 = 1.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 = 1.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 = 1.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 = 1.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 = 1.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 = 1.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 = 1.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2 = 1.open1_mean_cat_all#18.week_from_opening_7_5_2) coeflabels(1.open1_mean_cat_all#1.week_from_opening_7_5_2 = "-4" 1.open1_mean_cat_all#2.week_from_opening_7_5_2 = "-3" 1.open1_mean_cat_all#3.week_from_opening_7_5_2 = "-2" 1.open1_mean_cat_all#4.week_from_opening_7_5_2 = "-1" 1.open1_mean_cat_all#5.week_from_opening_7_5_2 = "0" 1.open1_mean_cat_all#6.week_from_opening_7_5_2 = "1" 1.open1_mean_cat_all#7.week_from_opening_7_5_2 = "2" 1.open1_mean_cat_all#8.week_from_opening_7_5_2 = "3" 1.open1_mean_cat_all#9.week_from_opening_7_5_2 = "4" 1.open1_mean_cat_all#10.week_from_opening_7_5_2 = "5" 1.open1_mean_cat_all#11.week_from_opening_7_5_2  = "6" 1.open1_mean_cat_all#12.week_from_opening_7_5_2 = "7" 1.open1_mean_cat_all#13.week_from_opening_7_5_2 = "8" 1.open1_mean_cat_all#14.week_from_opening_7_5_2 = "9" 1.open1_mean_cat_all#15.week_from_opening_7_5_2 = "10" 1.open1_mean_cat_all#16.week_from_opening_7_5_2 = "11" 1.open1_mean_cat_all#17.week_from_opening_7_5_2 = "12" 1.open1_mean_cat_all#18.week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)


graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Change from Baseline - Mask Mandate 3&4 - W - 210406.gph", replace
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Change from Baseline - Mask Mandate 3&4 - W - 210406.jpg", as(jpg) name("Graph") quality(100) replace



***WITHOUT MASK MANDATE 3&4
**W
*running it once and saving the estimates as hybrid
reg cases_per_pop_bl_diff i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if h6_facialcoverings34_all == 0 & region == 1, vce(cluster fips)

estimates store change_bl_hybrid_nomm34_w

*running it again and saving the estimates as traditional
reg cases_per_pop_bl_diff i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if h6_facialcoverings34_all == 0 & region == 1, vce(cluster fips)

estimates store change_bl_trad_nomm34_w

**PLOTTING THE COEFFICIENTS*****
coefplot (change_bl_hybrid_nomm34_w, keep(1.open1_mean_cat_all#1.week_from_opening_7_5_2 1.open1_mean_cat_all#2.week_from_opening_7_5_2 1.open1_mean_cat_all#3.week_from_opening_7_5_2 1.open1_mean_cat_all#4.week_from_opening_7_5_2 1.open1_mean_cat_all#5.week_from_opening_7_5_2 1.open1_mean_cat_all#6.week_from_opening_7_5_2 1.open1_mean_cat_all#7.week_from_opening_7_5_2 1.open1_mean_cat_all#8.week_from_opening_7_5_2 1.open1_mean_cat_all#9.week_from_opening_7_5_2 1.open1_mean_cat_all#10.week_from_opening_7_5_2 1.open1_mean_cat_all#11.week_from_opening_7_5_2 1.open1_mean_cat_all#12.week_from_opening_7_5_2 1.open1_mean_cat_all#13.week_from_opening_7_5_2 1.open1_mean_cat_all#14.week_from_opening_7_5_2 1.open1_mean_cat_all#15.week_from_opening_7_5_2 1.open1_mean_cat_all#16.week_from_opening_7_5_2 1.open1_mean_cat_all#17.week_from_opening_7_5_2 1.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Hybrid) mlcolor(black))   (change_bl_trad_nomm34_w, keep(2.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Traditional) mlcolor(black)), yline(0, lcolor(black) lpattern(dash)) vertical rename(2.open1_mean_cat_all#1.week_from_opening_7_5_2 = 1.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 = 1.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 = 1.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 = 1.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 = 1.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 = 1.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 = 1.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 = 1.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 = 1.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 = 1.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 = 1.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 = 1.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 = 1.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 = 1.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 = 1.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 = 1.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 = 1.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2 = 1.open1_mean_cat_all#18.week_from_opening_7_5_2) coeflabels(1.open1_mean_cat_all#1.week_from_opening_7_5_2 = "-4" 1.open1_mean_cat_all#2.week_from_opening_7_5_2 = "-3" 1.open1_mean_cat_all#3.week_from_opening_7_5_2 = "-2" 1.open1_mean_cat_all#4.week_from_opening_7_5_2 = "-1" 1.open1_mean_cat_all#5.week_from_opening_7_5_2 = "0" 1.open1_mean_cat_all#6.week_from_opening_7_5_2 = "1" 1.open1_mean_cat_all#7.week_from_opening_7_5_2 = "2" 1.open1_mean_cat_all#8.week_from_opening_7_5_2 = "3" 1.open1_mean_cat_all#9.week_from_opening_7_5_2 = "4" 1.open1_mean_cat_all#10.week_from_opening_7_5_2 = "5" 1.open1_mean_cat_all#11.week_from_opening_7_5_2  = "6" 1.open1_mean_cat_all#12.week_from_opening_7_5_2 = "7" 1.open1_mean_cat_all#13.week_from_opening_7_5_2 = "8" 1.open1_mean_cat_all#14.week_from_opening_7_5_2 = "9" 1.open1_mean_cat_all#15.week_from_opening_7_5_2 = "10" 1.open1_mean_cat_all#16.week_from_opening_7_5_2 = "11" 1.open1_mean_cat_all#17.week_from_opening_7_5_2 = "12" 1.open1_mean_cat_all#18.week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)


graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Change from Baseline - No Mask Mandate 3&4 - W - 210406.gph", replace
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Change from Baseline - No Mask Mandate 3&4 - W - 210406.jpg", as(jpg) name("Graph") quality(100) replace







*WITH A MASK MANDATE
**MW
*running it once and saving the estimates as hybrid
reg cases_per_pop_bl_diff i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if h6_facialcoverings34_all == 1 & region == 2, vce(cluster fips)

estimates store change_bl_hybrid_mm34_mw

*running it again and saving the estimates as traditional
reg cases_per_pop_bl_diff i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if h6_facialcoverings34_all == 1 & region == 2, vce(cluster fips)

estimates store change_bl_trad_mm34_mw

**PLOTTING THE COEFFICIENTS*****
coefplot (change_bl_hybrid_mm34_mw, keep(1.open1_mean_cat_all#1.week_from_opening_7_5_2 1.open1_mean_cat_all#2.week_from_opening_7_5_2 1.open1_mean_cat_all#3.week_from_opening_7_5_2 1.open1_mean_cat_all#4.week_from_opening_7_5_2 1.open1_mean_cat_all#5.week_from_opening_7_5_2 1.open1_mean_cat_all#6.week_from_opening_7_5_2 1.open1_mean_cat_all#7.week_from_opening_7_5_2 1.open1_mean_cat_all#8.week_from_opening_7_5_2 1.open1_mean_cat_all#9.week_from_opening_7_5_2 1.open1_mean_cat_all#10.week_from_opening_7_5_2 1.open1_mean_cat_all#11.week_from_opening_7_5_2 1.open1_mean_cat_all#12.week_from_opening_7_5_2 1.open1_mean_cat_all#13.week_from_opening_7_5_2 1.open1_mean_cat_all#14.week_from_opening_7_5_2 1.open1_mean_cat_all#15.week_from_opening_7_5_2 1.open1_mean_cat_all#16.week_from_opening_7_5_2 1.open1_mean_cat_all#17.week_from_opening_7_5_2 1.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Hybrid) mlcolor(black))   (change_bl_trad_mm34_mw, keep(2.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Traditional) mlcolor(black)), yline(0, lcolor(black) lpattern(dash)) vertical rename(2.open1_mean_cat_all#1.week_from_opening_7_5_2 = 1.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 = 1.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 = 1.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 = 1.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 = 1.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 = 1.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 = 1.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 = 1.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 = 1.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 = 1.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 = 1.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 = 1.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 = 1.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 = 1.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 = 1.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 = 1.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 = 1.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2 = 1.open1_mean_cat_all#18.week_from_opening_7_5_2) coeflabels(1.open1_mean_cat_all#1.week_from_opening_7_5_2 = "-4" 1.open1_mean_cat_all#2.week_from_opening_7_5_2 = "-3" 1.open1_mean_cat_all#3.week_from_opening_7_5_2 = "-2" 1.open1_mean_cat_all#4.week_from_opening_7_5_2 = "-1" 1.open1_mean_cat_all#5.week_from_opening_7_5_2 = "0" 1.open1_mean_cat_all#6.week_from_opening_7_5_2 = "1" 1.open1_mean_cat_all#7.week_from_opening_7_5_2 = "2" 1.open1_mean_cat_all#8.week_from_opening_7_5_2 = "3" 1.open1_mean_cat_all#9.week_from_opening_7_5_2 = "4" 1.open1_mean_cat_all#10.week_from_opening_7_5_2 = "5" 1.open1_mean_cat_all#11.week_from_opening_7_5_2  = "6" 1.open1_mean_cat_all#12.week_from_opening_7_5_2 = "7" 1.open1_mean_cat_all#13.week_from_opening_7_5_2 = "8" 1.open1_mean_cat_all#14.week_from_opening_7_5_2 = "9" 1.open1_mean_cat_all#15.week_from_opening_7_5_2 = "10" 1.open1_mean_cat_all#16.week_from_opening_7_5_2 = "11" 1.open1_mean_cat_all#17.week_from_opening_7_5_2 = "12" 1.open1_mean_cat_all#18.week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)


graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Change from Baseline - Mask Mandate 3&4 - MW - 210406.gph", replace
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Change from Baseline - Mask Mandate 3&4 - MW - 210406.jpg", as(jpg) name("Graph") quality(100) replace



***WITHOUT MASK MANDATE 3&4
**MW
*running it once and saving the estimates as hybrid
reg cases_per_pop_bl_diff i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if h6_facialcoverings34_all == 0 & region == 2, vce(cluster fips)

estimates store change_bl_hybrid_nomm34_mw

*running it again and saving the estimates as traditional
reg cases_per_pop_bl_diff i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if h6_facialcoverings34_all == 0 & region == 2, vce(cluster fips)

estimates store change_bl_trad_nomm34_mw

**PLOTTING THE COEFFICIENTS*****
coefplot (change_bl_hybrid_nomm34_mw, keep(1.open1_mean_cat_all#1.week_from_opening_7_5_2 1.open1_mean_cat_all#2.week_from_opening_7_5_2 1.open1_mean_cat_all#3.week_from_opening_7_5_2 1.open1_mean_cat_all#4.week_from_opening_7_5_2 1.open1_mean_cat_all#5.week_from_opening_7_5_2 1.open1_mean_cat_all#6.week_from_opening_7_5_2 1.open1_mean_cat_all#7.week_from_opening_7_5_2 1.open1_mean_cat_all#8.week_from_opening_7_5_2 1.open1_mean_cat_all#9.week_from_opening_7_5_2 1.open1_mean_cat_all#10.week_from_opening_7_5_2 1.open1_mean_cat_all#11.week_from_opening_7_5_2 1.open1_mean_cat_all#12.week_from_opening_7_5_2 1.open1_mean_cat_all#13.week_from_opening_7_5_2 1.open1_mean_cat_all#14.week_from_opening_7_5_2 1.open1_mean_cat_all#15.week_from_opening_7_5_2 1.open1_mean_cat_all#16.week_from_opening_7_5_2 1.open1_mean_cat_all#17.week_from_opening_7_5_2 1.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Hybrid) mlcolor(black))   (change_bl_trad_nomm34_mw, keep(2.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Traditional) mlcolor(black)), yline(0, lcolor(black) lpattern(dash)) vertical rename(2.open1_mean_cat_all#1.week_from_opening_7_5_2 = 1.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 = 1.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 = 1.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 = 1.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 = 1.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 = 1.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 = 1.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 = 1.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 = 1.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 = 1.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 = 1.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 = 1.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 = 1.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 = 1.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 = 1.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 = 1.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 = 1.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2 = 1.open1_mean_cat_all#18.week_from_opening_7_5_2) coeflabels(1.open1_mean_cat_all#1.week_from_opening_7_5_2 = "-4" 1.open1_mean_cat_all#2.week_from_opening_7_5_2 = "-3" 1.open1_mean_cat_all#3.week_from_opening_7_5_2 = "-2" 1.open1_mean_cat_all#4.week_from_opening_7_5_2 = "-1" 1.open1_mean_cat_all#5.week_from_opening_7_5_2 = "0" 1.open1_mean_cat_all#6.week_from_opening_7_5_2 = "1" 1.open1_mean_cat_all#7.week_from_opening_7_5_2 = "2" 1.open1_mean_cat_all#8.week_from_opening_7_5_2 = "3" 1.open1_mean_cat_all#9.week_from_opening_7_5_2 = "4" 1.open1_mean_cat_all#10.week_from_opening_7_5_2 = "5" 1.open1_mean_cat_all#11.week_from_opening_7_5_2  = "6" 1.open1_mean_cat_all#12.week_from_opening_7_5_2 = "7" 1.open1_mean_cat_all#13.week_from_opening_7_5_2 = "8" 1.open1_mean_cat_all#14.week_from_opening_7_5_2 = "9" 1.open1_mean_cat_all#15.week_from_opening_7_5_2 = "10" 1.open1_mean_cat_all#16.week_from_opening_7_5_2 = "11" 1.open1_mean_cat_all#17.week_from_opening_7_5_2 = "12" 1.open1_mean_cat_all#18.week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)


graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Change from Baseline - No Mask Mandate 3&4 - MW - 210406.gph", replace
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Change from Baseline - No Mask Mandate 3&4 - MW - 210406.jpg", as(jpg) name("Graph") quality(100) replace








*WITH A MASK MANDATE
**S
*running it once and saving the estimates as hybrid
reg cases_per_pop_bl_diff i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if h6_facialcoverings34_all == 1 & region == 3, vce(cluster fips)

estimates store change_bl_hybrid_mm34_s

*running it again and saving the estimates as traditional
reg cases_per_pop_bl_diff i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if h6_facialcoverings34_all == 1 & region == 3, vce(cluster fips)

estimates store change_bl_trad_mm34_s

**PLOTTING THE COEFFICIENTS*****
coefplot (change_bl_hybrid_mm34_s, keep(1.open1_mean_cat_all#1.week_from_opening_7_5_2 1.open1_mean_cat_all#2.week_from_opening_7_5_2 1.open1_mean_cat_all#3.week_from_opening_7_5_2 1.open1_mean_cat_all#4.week_from_opening_7_5_2 1.open1_mean_cat_all#5.week_from_opening_7_5_2 1.open1_mean_cat_all#6.week_from_opening_7_5_2 1.open1_mean_cat_all#7.week_from_opening_7_5_2 1.open1_mean_cat_all#8.week_from_opening_7_5_2 1.open1_mean_cat_all#9.week_from_opening_7_5_2 1.open1_mean_cat_all#10.week_from_opening_7_5_2 1.open1_mean_cat_all#11.week_from_opening_7_5_2 1.open1_mean_cat_all#12.week_from_opening_7_5_2 1.open1_mean_cat_all#13.week_from_opening_7_5_2 1.open1_mean_cat_all#14.week_from_opening_7_5_2 1.open1_mean_cat_all#15.week_from_opening_7_5_2 1.open1_mean_cat_all#16.week_from_opening_7_5_2 1.open1_mean_cat_all#17.week_from_opening_7_5_2 1.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Hybrid) mlcolor(black))   (change_bl_trad_mm_s, keep(2.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Traditional) mlcolor(black)), yline(0, lcolor(black) lpattern(dash)) vertical rename(2.open1_mean_cat_all#1.week_from_opening_7_5_2 = 1.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 = 1.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 = 1.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 = 1.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 = 1.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 = 1.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 = 1.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 = 1.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 = 1.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 = 1.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 = 1.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 = 1.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 = 1.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 = 1.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 = 1.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 = 1.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 = 1.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2 = 1.open1_mean_cat_all#18.week_from_opening_7_5_2) coeflabels(1.open1_mean_cat_all#1.week_from_opening_7_5_2 = "-4" 1.open1_mean_cat_all#2.week_from_opening_7_5_2 = "-3" 1.open1_mean_cat_all#3.week_from_opening_7_5_2 = "-2" 1.open1_mean_cat_all#4.week_from_opening_7_5_2 = "-1" 1.open1_mean_cat_all#5.week_from_opening_7_5_2 = "0" 1.open1_mean_cat_all#6.week_from_opening_7_5_2 = "1" 1.open1_mean_cat_all#7.week_from_opening_7_5_2 = "2" 1.open1_mean_cat_all#8.week_from_opening_7_5_2 = "3" 1.open1_mean_cat_all#9.week_from_opening_7_5_2 = "4" 1.open1_mean_cat_all#10.week_from_opening_7_5_2 = "5" 1.open1_mean_cat_all#11.week_from_opening_7_5_2  = "6" 1.open1_mean_cat_all#12.week_from_opening_7_5_2 = "7" 1.open1_mean_cat_all#13.week_from_opening_7_5_2 = "8" 1.open1_mean_cat_all#14.week_from_opening_7_5_2 = "9" 1.open1_mean_cat_all#15.week_from_opening_7_5_2 = "10" 1.open1_mean_cat_all#16.week_from_opening_7_5_2 = "11" 1.open1_mean_cat_all#17.week_from_opening_7_5_2 = "12" 1.open1_mean_cat_all#18.week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)


graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Change from Baseline - Mask Mandate 3&4 - S - 210406.gph", replace
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Change from Baseline - Mask Mandate 3&4 - S - 210406.jpg", as(jpg) name("Graph") quality(100) replace



***WITHOUT MASK MANDATE 3&4
**S
*running it once and saving the estimates as hybrid
reg cases_per_pop_bl_diff i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if h6_facialcoverings34_all == 0 & region == 3, vce(cluster fips)

estimates store change_bl_hybrid_nomm34_s

*running it again and saving the estimates as traditional
reg cases_per_pop_bl_diff i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if h6_facialcoverings34_all == 0 & region == 3, vce(cluster fips)

estimates store change_bl_trad_nomm34_s

**PLOTTING THE COEFFICIENTS*****
coefplot (change_bl_hybrid_nomm34_s, keep(1.open1_mean_cat_all#1.week_from_opening_7_5_2 1.open1_mean_cat_all#2.week_from_opening_7_5_2 1.open1_mean_cat_all#3.week_from_opening_7_5_2 1.open1_mean_cat_all#4.week_from_opening_7_5_2 1.open1_mean_cat_all#5.week_from_opening_7_5_2 1.open1_mean_cat_all#6.week_from_opening_7_5_2 1.open1_mean_cat_all#7.week_from_opening_7_5_2 1.open1_mean_cat_all#8.week_from_opening_7_5_2 1.open1_mean_cat_all#9.week_from_opening_7_5_2 1.open1_mean_cat_all#10.week_from_opening_7_5_2 1.open1_mean_cat_all#11.week_from_opening_7_5_2 1.open1_mean_cat_all#12.week_from_opening_7_5_2 1.open1_mean_cat_all#13.week_from_opening_7_5_2 1.open1_mean_cat_all#14.week_from_opening_7_5_2 1.open1_mean_cat_all#15.week_from_opening_7_5_2 1.open1_mean_cat_all#16.week_from_opening_7_5_2 1.open1_mean_cat_all#17.week_from_opening_7_5_2 1.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Hybrid) mlcolor(black))   (change_bl_trad_nomm34_s, keep(2.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Traditional) mlcolor(black)), yline(0, lcolor(black) lpattern(dash)) vertical rename(2.open1_mean_cat_all#1.week_from_opening_7_5_2 = 1.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 = 1.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 = 1.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 = 1.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 = 1.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 = 1.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 = 1.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 = 1.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 = 1.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 = 1.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 = 1.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 = 1.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 = 1.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 = 1.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 = 1.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 = 1.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 = 1.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2 = 1.open1_mean_cat_all#18.week_from_opening_7_5_2) coeflabels(1.open1_mean_cat_all#1.week_from_opening_7_5_2 = "-4" 1.open1_mean_cat_all#2.week_from_opening_7_5_2 = "-3" 1.open1_mean_cat_all#3.week_from_opening_7_5_2 = "-2" 1.open1_mean_cat_all#4.week_from_opening_7_5_2 = "-1" 1.open1_mean_cat_all#5.week_from_opening_7_5_2 = "0" 1.open1_mean_cat_all#6.week_from_opening_7_5_2 = "1" 1.open1_mean_cat_all#7.week_from_opening_7_5_2 = "2" 1.open1_mean_cat_all#8.week_from_opening_7_5_2 = "3" 1.open1_mean_cat_all#9.week_from_opening_7_5_2 = "4" 1.open1_mean_cat_all#10.week_from_opening_7_5_2 = "5" 1.open1_mean_cat_all#11.week_from_opening_7_5_2  = "6" 1.open1_mean_cat_all#12.week_from_opening_7_5_2 = "7" 1.open1_mean_cat_all#13.week_from_opening_7_5_2 = "8" 1.open1_mean_cat_all#14.week_from_opening_7_5_2 = "9" 1.open1_mean_cat_all#15.week_from_opening_7_5_2 = "10" 1.open1_mean_cat_all#16.week_from_opening_7_5_2 = "11" 1.open1_mean_cat_all#17.week_from_opening_7_5_2 = "12" 1.open1_mean_cat_all#18.week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)


graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Change from Baseline - No Mask Mandate 3&4 - S - 210406.gph", replace
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Change from Baseline - No Mask Mandate 3&4 - S - 210406.jpg", as(jpg) name("Graph") quality(100) replace









****CHANGE FROM BASELINE***
****MASK MANDATE WRIGHT********
*****************************


**WITH MASK MANDATE
**overall
*running it once and saving the estimates as hybrid
reg cases_per_pop_bl_diff i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if mask_mandate_wright_opening_all == 1, vce(cluster fips)

estimates store change_bl_hybrid_mmw_overall

*running it again and saving the estimates as traditional
reg cases_per_pop_bl_diff i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if mask_mandate_wright_opening_all == 1, vce(cluster fips)

estimates store change_bl_trad_mmw_overall

**PLOTTING THE COEFFICIENTS*****
coefplot (change_bl_hybrid_mmw_overall, keep(1.open1_mean_cat_all#1.week_from_opening_7_5_2 1.open1_mean_cat_all#2.week_from_opening_7_5_2 1.open1_mean_cat_all#3.week_from_opening_7_5_2 1.open1_mean_cat_all#4.week_from_opening_7_5_2 1.open1_mean_cat_all#5.week_from_opening_7_5_2 1.open1_mean_cat_all#6.week_from_opening_7_5_2 1.open1_mean_cat_all#7.week_from_opening_7_5_2 1.open1_mean_cat_all#8.week_from_opening_7_5_2 1.open1_mean_cat_all#9.week_from_opening_7_5_2 1.open1_mean_cat_all#10.week_from_opening_7_5_2 1.open1_mean_cat_all#11.week_from_opening_7_5_2 1.open1_mean_cat_all#12.week_from_opening_7_5_2 1.open1_mean_cat_all#13.week_from_opening_7_5_2 1.open1_mean_cat_all#14.week_from_opening_7_5_2 1.open1_mean_cat_all#15.week_from_opening_7_5_2 1.open1_mean_cat_all#16.week_from_opening_7_5_2 1.open1_mean_cat_all#17.week_from_opening_7_5_2 1.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Hybrid) mlcolor(black))   (change_bl_trad_mmw_overall, keep(2.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Traditional) mlcolor(black)), yline(0, lcolor(black) lpattern(dash)) vertical rename(2.open1_mean_cat_all#1.week_from_opening_7_5_2 = 1.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 = 1.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 = 1.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 = 1.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 = 1.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 = 1.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 = 1.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 = 1.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 = 1.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 = 1.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 = 1.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 = 1.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 = 1.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 = 1.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 = 1.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 = 1.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 = 1.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2 = 1.open1_mean_cat_all#18.week_from_opening_7_5_2) coeflabels(1.open1_mean_cat_all#1.week_from_opening_7_5_2 = "-4" 1.open1_mean_cat_all#2.week_from_opening_7_5_2 = "-3" 1.open1_mean_cat_all#3.week_from_opening_7_5_2 = "-2" 1.open1_mean_cat_all#4.week_from_opening_7_5_2 = "-1" 1.open1_mean_cat_all#5.week_from_opening_7_5_2 = "0" 1.open1_mean_cat_all#6.week_from_opening_7_5_2 = "1" 1.open1_mean_cat_all#7.week_from_opening_7_5_2 = "2" 1.open1_mean_cat_all#8.week_from_opening_7_5_2 = "3" 1.open1_mean_cat_all#9.week_from_opening_7_5_2 = "4" 1.open1_mean_cat_all#10.week_from_opening_7_5_2 = "5" 1.open1_mean_cat_all#11.week_from_opening_7_5_2  = "6" 1.open1_mean_cat_all#12.week_from_opening_7_5_2 = "7" 1.open1_mean_cat_all#13.week_from_opening_7_5_2 = "8" 1.open1_mean_cat_all#14.week_from_opening_7_5_2 = "9" 1.open1_mean_cat_all#15.week_from_opening_7_5_2 = "10" 1.open1_mean_cat_all#16.week_from_opening_7_5_2 = "11" 1.open1_mean_cat_all#17.week_from_opening_7_5_2 = "12" 1.open1_mean_cat_all#18.week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)


graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Change from Baseline - Mask Mandate Wright - 210406.gph", replace
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Change from Baseline - Mask Mandate Wright - 210406.jpg", as(jpg) name("Graph") quality(100) replace



***WITHOUT MASK MANDATE 3&4
**overall
*running it once and saving the estimates as hybrid
reg cases_per_pop_bl_diff i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if mask_mandate_wright_opening_all == 0, vce(cluster fips)

estimates store change_bl_hybrid_nommw_all

*running it again and saving the estimates as traditional
reg cases_per_pop_bl_diff i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if mask_mandate_wright_opening_all == 0, vce(cluster fips)

estimates store change_bl_trad_nommw_all

**PLOTTING THE COEFFICIENTS*****
coefplot (change_bl_hybrid_nommw_all, keep(1.open1_mean_cat_all#1.week_from_opening_7_5_2 1.open1_mean_cat_all#2.week_from_opening_7_5_2 1.open1_mean_cat_all#3.week_from_opening_7_5_2 1.open1_mean_cat_all#4.week_from_opening_7_5_2 1.open1_mean_cat_all#5.week_from_opening_7_5_2 1.open1_mean_cat_all#6.week_from_opening_7_5_2 1.open1_mean_cat_all#7.week_from_opening_7_5_2 1.open1_mean_cat_all#8.week_from_opening_7_5_2 1.open1_mean_cat_all#9.week_from_opening_7_5_2 1.open1_mean_cat_all#10.week_from_opening_7_5_2 1.open1_mean_cat_all#11.week_from_opening_7_5_2 1.open1_mean_cat_all#12.week_from_opening_7_5_2 1.open1_mean_cat_all#13.week_from_opening_7_5_2 1.open1_mean_cat_all#14.week_from_opening_7_5_2 1.open1_mean_cat_all#15.week_from_opening_7_5_2 1.open1_mean_cat_all#16.week_from_opening_7_5_2 1.open1_mean_cat_all#17.week_from_opening_7_5_2 1.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Hybrid) mlcolor(black))   (change_bl_trad_nommw_all, keep(2.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Traditional) mlcolor(black)), yline(0, lcolor(black) lpattern(dash)) vertical rename(2.open1_mean_cat_all#1.week_from_opening_7_5_2 = 1.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 = 1.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 = 1.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 = 1.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 = 1.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 = 1.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 = 1.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 = 1.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 = 1.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 = 1.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 = 1.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 = 1.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 = 1.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 = 1.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 = 1.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 = 1.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 = 1.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2 = 1.open1_mean_cat_all#18.week_from_opening_7_5_2) coeflabels(1.open1_mean_cat_all#1.week_from_opening_7_5_2 = "-4" 1.open1_mean_cat_all#2.week_from_opening_7_5_2 = "-3" 1.open1_mean_cat_all#3.week_from_opening_7_5_2 = "-2" 1.open1_mean_cat_all#4.week_from_opening_7_5_2 = "-1" 1.open1_mean_cat_all#5.week_from_opening_7_5_2 = "0" 1.open1_mean_cat_all#6.week_from_opening_7_5_2 = "1" 1.open1_mean_cat_all#7.week_from_opening_7_5_2 = "2" 1.open1_mean_cat_all#8.week_from_opening_7_5_2 = "3" 1.open1_mean_cat_all#9.week_from_opening_7_5_2 = "4" 1.open1_mean_cat_all#10.week_from_opening_7_5_2 = "5" 1.open1_mean_cat_all#11.week_from_opening_7_5_2  = "6" 1.open1_mean_cat_all#12.week_from_opening_7_5_2 = "7" 1.open1_mean_cat_all#13.week_from_opening_7_5_2 = "8" 1.open1_mean_cat_all#14.week_from_opening_7_5_2 = "9" 1.open1_mean_cat_all#15.week_from_opening_7_5_2 = "10" 1.open1_mean_cat_all#16.week_from_opening_7_5_2 = "11" 1.open1_mean_cat_all#17.week_from_opening_7_5_2 = "12" 1.open1_mean_cat_all#18.week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)


graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Change from Baseline - No Mask Mandate Wright - 210406.gph", replace
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Change from Baseline - No Mask Mandate Wright - 210406.jpg", as(jpg) name("Graph") quality(100) replace







*WITH A MASK MANDATE
**NE
*running it once and saving the estimates as hybrid
reg cases_per_pop_bl_diff i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if mask_mandate_wright_opening_all == 1 & region == 0, vce(cluster fips)

estimates store change_bl_hybrid_mmw_ne

*running it again and saving the estimates as traditional
reg cases_per_pop_bl_diff i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if mask_mandate_wright_opening_all == 1 & region == 0, vce(cluster fips)

estimates store change_bl_trad_mmw_ne

**PLOTTING THE COEFFICIENTS*****
coefplot (change_bl_hybrid_mmw_ne, keep(1.open1_mean_cat_all#1.week_from_opening_7_5_2 1.open1_mean_cat_all#2.week_from_opening_7_5_2 1.open1_mean_cat_all#3.week_from_opening_7_5_2 1.open1_mean_cat_all#4.week_from_opening_7_5_2 1.open1_mean_cat_all#5.week_from_opening_7_5_2 1.open1_mean_cat_all#6.week_from_opening_7_5_2 1.open1_mean_cat_all#7.week_from_opening_7_5_2 1.open1_mean_cat_all#8.week_from_opening_7_5_2 1.open1_mean_cat_all#9.week_from_opening_7_5_2 1.open1_mean_cat_all#10.week_from_opening_7_5_2 1.open1_mean_cat_all#11.week_from_opening_7_5_2 1.open1_mean_cat_all#12.week_from_opening_7_5_2 1.open1_mean_cat_all#13.week_from_opening_7_5_2 1.open1_mean_cat_all#14.week_from_opening_7_5_2 1.open1_mean_cat_all#15.week_from_opening_7_5_2 1.open1_mean_cat_all#16.week_from_opening_7_5_2 1.open1_mean_cat_all#17.week_from_opening_7_5_2 1.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Hybrid) mlcolor(black))   (change_bl_trad_mmw_ne, keep(2.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Traditional) mlcolor(black)), yline(0, lcolor(black) lpattern(dash)) vertical rename(2.open1_mean_cat_all#1.week_from_opening_7_5_2 = 1.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 = 1.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 = 1.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 = 1.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 = 1.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 = 1.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 = 1.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 = 1.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 = 1.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 = 1.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 = 1.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 = 1.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 = 1.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 = 1.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 = 1.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 = 1.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 = 1.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2 = 1.open1_mean_cat_all#18.week_from_opening_7_5_2) coeflabels(1.open1_mean_cat_all#1.week_from_opening_7_5_2 = "-4" 1.open1_mean_cat_all#2.week_from_opening_7_5_2 = "-3" 1.open1_mean_cat_all#3.week_from_opening_7_5_2 = "-2" 1.open1_mean_cat_all#4.week_from_opening_7_5_2 = "-1" 1.open1_mean_cat_all#5.week_from_opening_7_5_2 = "0" 1.open1_mean_cat_all#6.week_from_opening_7_5_2 = "1" 1.open1_mean_cat_all#7.week_from_opening_7_5_2 = "2" 1.open1_mean_cat_all#8.week_from_opening_7_5_2 = "3" 1.open1_mean_cat_all#9.week_from_opening_7_5_2 = "4" 1.open1_mean_cat_all#10.week_from_opening_7_5_2 = "5" 1.open1_mean_cat_all#11.week_from_opening_7_5_2  = "6" 1.open1_mean_cat_all#12.week_from_opening_7_5_2 = "7" 1.open1_mean_cat_all#13.week_from_opening_7_5_2 = "8" 1.open1_mean_cat_all#14.week_from_opening_7_5_2 = "9" 1.open1_mean_cat_all#15.week_from_opening_7_5_2 = "10" 1.open1_mean_cat_all#16.week_from_opening_7_5_2 = "11" 1.open1_mean_cat_all#17.week_from_opening_7_5_2 = "12" 1.open1_mean_cat_all#18.week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)


graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Change from Baseline - Mask Mandate Wright - NE - 210406.gph", replace
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Change from Baseline - Mask Mandate Wright - NE - 210406.jpg", as(jpg) name("Graph") quality(100) replace



***WITHOUT MASK MANDATE 3&4
**NE
*running it once and saving the estimates as hybrid
reg cases_per_pop_bl_diff i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if mask_mandate_wright_opening_all == 0 & region == 0, vce(cluster fips)

estimates store change_bl_hybrid_nommw_ne

*running it again and saving the estimates as traditional
reg cases_per_pop_bl_diff i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if mask_mandate_wright_opening_all == 0 & region == 0, vce(cluster fips)

estimates store change_bl_trad_nommw_ne

**PLOTTING THE COEFFICIENTS*****
coefplot (change_bl_hybrid_nommw_ne, keep(1.open1_mean_cat_all#1.week_from_opening_7_5_2 1.open1_mean_cat_all#2.week_from_opening_7_5_2 1.open1_mean_cat_all#3.week_from_opening_7_5_2 1.open1_mean_cat_all#4.week_from_opening_7_5_2 1.open1_mean_cat_all#5.week_from_opening_7_5_2 1.open1_mean_cat_all#6.week_from_opening_7_5_2 1.open1_mean_cat_all#7.week_from_opening_7_5_2 1.open1_mean_cat_all#8.week_from_opening_7_5_2 1.open1_mean_cat_all#9.week_from_opening_7_5_2 1.open1_mean_cat_all#10.week_from_opening_7_5_2 1.open1_mean_cat_all#11.week_from_opening_7_5_2 1.open1_mean_cat_all#12.week_from_opening_7_5_2 1.open1_mean_cat_all#13.week_from_opening_7_5_2 1.open1_mean_cat_all#14.week_from_opening_7_5_2 1.open1_mean_cat_all#15.week_from_opening_7_5_2 1.open1_mean_cat_all#16.week_from_opening_7_5_2 1.open1_mean_cat_all#17.week_from_opening_7_5_2 1.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Hybrid) mlcolor(black))   (change_bl_trad_nommw_ne, keep(2.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Traditional) mlcolor(black)), yline(0, lcolor(black) lpattern(dash)) vertical rename(2.open1_mean_cat_all#1.week_from_opening_7_5_2 = 1.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 = 1.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 = 1.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 = 1.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 = 1.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 = 1.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 = 1.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 = 1.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 = 1.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 = 1.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 = 1.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 = 1.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 = 1.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 = 1.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 = 1.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 = 1.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 = 1.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2 = 1.open1_mean_cat_all#18.week_from_opening_7_5_2) coeflabels(1.open1_mean_cat_all#1.week_from_opening_7_5_2 = "-4" 1.open1_mean_cat_all#2.week_from_opening_7_5_2 = "-3" 1.open1_mean_cat_all#3.week_from_opening_7_5_2 = "-2" 1.open1_mean_cat_all#4.week_from_opening_7_5_2 = "-1" 1.open1_mean_cat_all#5.week_from_opening_7_5_2 = "0" 1.open1_mean_cat_all#6.week_from_opening_7_5_2 = "1" 1.open1_mean_cat_all#7.week_from_opening_7_5_2 = "2" 1.open1_mean_cat_all#8.week_from_opening_7_5_2 = "3" 1.open1_mean_cat_all#9.week_from_opening_7_5_2 = "4" 1.open1_mean_cat_all#10.week_from_opening_7_5_2 = "5" 1.open1_mean_cat_all#11.week_from_opening_7_5_2  = "6" 1.open1_mean_cat_all#12.week_from_opening_7_5_2 = "7" 1.open1_mean_cat_all#13.week_from_opening_7_5_2 = "8" 1.open1_mean_cat_all#14.week_from_opening_7_5_2 = "9" 1.open1_mean_cat_all#15.week_from_opening_7_5_2 = "10" 1.open1_mean_cat_all#16.week_from_opening_7_5_2 = "11" 1.open1_mean_cat_all#17.week_from_opening_7_5_2 = "12" 1.open1_mean_cat_all#18.week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)


graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Change from Baseline - No Mask Mandate Wright - NE - 210406.gph", replace
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Change from Baseline - No Mask Mandate Wright - NE - 210406.jpg", as(jpg) name("Graph") quality(100) replace






*WITH A MASK MANDATE
**W
*running it once and saving the estimates as hybrid
reg cases_per_pop_bl_diff i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if mask_mandate_wright_opening_all == 1 & region == 1, vce(cluster fips)

estimates store change_bl_hybrid_mmw_w

*running it again and saving the estimates as traditional
reg cases_per_pop_bl_diff i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if mask_mandate_wright_opening_all == 1 & region == 1, vce(cluster fips)

estimates store change_bl_trad_mmw_w

**PLOTTING THE COEFFICIENTS*****
coefplot (change_bl_hybrid_mmw_w, keep(1.open1_mean_cat_all#1.week_from_opening_7_5_2 1.open1_mean_cat_all#2.week_from_opening_7_5_2 1.open1_mean_cat_all#3.week_from_opening_7_5_2 1.open1_mean_cat_all#4.week_from_opening_7_5_2 1.open1_mean_cat_all#5.week_from_opening_7_5_2 1.open1_mean_cat_all#6.week_from_opening_7_5_2 1.open1_mean_cat_all#7.week_from_opening_7_5_2 1.open1_mean_cat_all#8.week_from_opening_7_5_2 1.open1_mean_cat_all#9.week_from_opening_7_5_2 1.open1_mean_cat_all#10.week_from_opening_7_5_2 1.open1_mean_cat_all#11.week_from_opening_7_5_2 1.open1_mean_cat_all#12.week_from_opening_7_5_2 1.open1_mean_cat_all#13.week_from_opening_7_5_2 1.open1_mean_cat_all#14.week_from_opening_7_5_2 1.open1_mean_cat_all#15.week_from_opening_7_5_2 1.open1_mean_cat_all#16.week_from_opening_7_5_2 1.open1_mean_cat_all#17.week_from_opening_7_5_2 1.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Hybrid) mlcolor(black))   (change_bl_trad_mmw_w, keep(2.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Traditional) mlcolor(black)), yline(0, lcolor(black) lpattern(dash)) vertical rename(2.open1_mean_cat_all#1.week_from_opening_7_5_2 = 1.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 = 1.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 = 1.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 = 1.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 = 1.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 = 1.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 = 1.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 = 1.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 = 1.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 = 1.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 = 1.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 = 1.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 = 1.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 = 1.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 = 1.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 = 1.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 = 1.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2 = 1.open1_mean_cat_all#18.week_from_opening_7_5_2) coeflabels(1.open1_mean_cat_all#1.week_from_opening_7_5_2 = "-4" 1.open1_mean_cat_all#2.week_from_opening_7_5_2 = "-3" 1.open1_mean_cat_all#3.week_from_opening_7_5_2 = "-2" 1.open1_mean_cat_all#4.week_from_opening_7_5_2 = "-1" 1.open1_mean_cat_all#5.week_from_opening_7_5_2 = "0" 1.open1_mean_cat_all#6.week_from_opening_7_5_2 = "1" 1.open1_mean_cat_all#7.week_from_opening_7_5_2 = "2" 1.open1_mean_cat_all#8.week_from_opening_7_5_2 = "3" 1.open1_mean_cat_all#9.week_from_opening_7_5_2 = "4" 1.open1_mean_cat_all#10.week_from_opening_7_5_2 = "5" 1.open1_mean_cat_all#11.week_from_opening_7_5_2  = "6" 1.open1_mean_cat_all#12.week_from_opening_7_5_2 = "7" 1.open1_mean_cat_all#13.week_from_opening_7_5_2 = "8" 1.open1_mean_cat_all#14.week_from_opening_7_5_2 = "9" 1.open1_mean_cat_all#15.week_from_opening_7_5_2 = "10" 1.open1_mean_cat_all#16.week_from_opening_7_5_2 = "11" 1.open1_mean_cat_all#17.week_from_opening_7_5_2 = "12" 1.open1_mean_cat_all#18.week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)


graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Change from Baseline - Mask Mandate Wright - W - 210406.gph", replace
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Change from Baseline - Mask Mandate Wright - W - 210406.jpg", as(jpg) name("Graph") quality(100) replace



***WITHOUT MASK MANDATE 3&4
**W
*running it once and saving the estimates as hybrid
reg cases_per_pop_bl_diff i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if mask_mandate_wright_opening_all == 0 & region == 1, vce(cluster fips)

estimates store change_bl_hybrid_nommw_w

*running it again and saving the estimates as traditional
reg cases_per_pop_bl_diff i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if mask_mandate_wright_opening_all == 0 & region == 1, vce(cluster fips)

estimates store change_bl_trad_nommw_w

**PLOTTING THE COEFFICIENTS*****
coefplot (change_bl_hybrid_nommw_w, keep(1.open1_mean_cat_all#1.week_from_opening_7_5_2 1.open1_mean_cat_all#2.week_from_opening_7_5_2 1.open1_mean_cat_all#3.week_from_opening_7_5_2 1.open1_mean_cat_all#4.week_from_opening_7_5_2 1.open1_mean_cat_all#5.week_from_opening_7_5_2 1.open1_mean_cat_all#6.week_from_opening_7_5_2 1.open1_mean_cat_all#7.week_from_opening_7_5_2 1.open1_mean_cat_all#8.week_from_opening_7_5_2 1.open1_mean_cat_all#9.week_from_opening_7_5_2 1.open1_mean_cat_all#10.week_from_opening_7_5_2 1.open1_mean_cat_all#11.week_from_opening_7_5_2 1.open1_mean_cat_all#12.week_from_opening_7_5_2 1.open1_mean_cat_all#13.week_from_opening_7_5_2 1.open1_mean_cat_all#14.week_from_opening_7_5_2 1.open1_mean_cat_all#15.week_from_opening_7_5_2 1.open1_mean_cat_all#16.week_from_opening_7_5_2 1.open1_mean_cat_all#17.week_from_opening_7_5_2 1.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Hybrid) mlcolor(black))   (change_bl_trad_nommw_w, keep(2.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Traditional) mlcolor(black)), yline(0, lcolor(black) lpattern(dash)) vertical rename(2.open1_mean_cat_all#1.week_from_opening_7_5_2 = 1.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 = 1.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 = 1.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 = 1.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 = 1.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 = 1.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 = 1.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 = 1.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 = 1.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 = 1.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 = 1.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 = 1.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 = 1.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 = 1.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 = 1.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 = 1.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 = 1.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2 = 1.open1_mean_cat_all#18.week_from_opening_7_5_2) coeflabels(1.open1_mean_cat_all#1.week_from_opening_7_5_2 = "-4" 1.open1_mean_cat_all#2.week_from_opening_7_5_2 = "-3" 1.open1_mean_cat_all#3.week_from_opening_7_5_2 = "-2" 1.open1_mean_cat_all#4.week_from_opening_7_5_2 = "-1" 1.open1_mean_cat_all#5.week_from_opening_7_5_2 = "0" 1.open1_mean_cat_all#6.week_from_opening_7_5_2 = "1" 1.open1_mean_cat_all#7.week_from_opening_7_5_2 = "2" 1.open1_mean_cat_all#8.week_from_opening_7_5_2 = "3" 1.open1_mean_cat_all#9.week_from_opening_7_5_2 = "4" 1.open1_mean_cat_all#10.week_from_opening_7_5_2 = "5" 1.open1_mean_cat_all#11.week_from_opening_7_5_2  = "6" 1.open1_mean_cat_all#12.week_from_opening_7_5_2 = "7" 1.open1_mean_cat_all#13.week_from_opening_7_5_2 = "8" 1.open1_mean_cat_all#14.week_from_opening_7_5_2 = "9" 1.open1_mean_cat_all#15.week_from_opening_7_5_2 = "10" 1.open1_mean_cat_all#16.week_from_opening_7_5_2 = "11" 1.open1_mean_cat_all#17.week_from_opening_7_5_2 = "12" 1.open1_mean_cat_all#18.week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)


graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Change from Baseline - No Mask Mandate Wright - W - 210406.gph", replace
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Change from Baseline - No Mask Mandate Wright - W - 210406.jpg", as(jpg) name("Graph") quality(100) replace







*WITH A MASK MANDATE
**MW
*running it once and saving the estimates as hybrid
reg cases_per_pop_bl_diff i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if mask_mandate_wright_opening_all == 1 & region == 2, vce(cluster fips)

estimates store change_bl_hybrid_mmw_mw

*running it again and saving the estimates as traditional
reg cases_per_pop_bl_diff i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if mask_mandate_wright_opening_all == 1 & region == 2, vce(cluster fips)

estimates store change_bl_trad_mmw_mw

**PLOTTING THE COEFFICIENTS*****
coefplot (change_bl_hybrid_mmw_mw, keep(1.open1_mean_cat_all#1.week_from_opening_7_5_2 1.open1_mean_cat_all#2.week_from_opening_7_5_2 1.open1_mean_cat_all#3.week_from_opening_7_5_2 1.open1_mean_cat_all#4.week_from_opening_7_5_2 1.open1_mean_cat_all#5.week_from_opening_7_5_2 1.open1_mean_cat_all#6.week_from_opening_7_5_2 1.open1_mean_cat_all#7.week_from_opening_7_5_2 1.open1_mean_cat_all#8.week_from_opening_7_5_2 1.open1_mean_cat_all#9.week_from_opening_7_5_2 1.open1_mean_cat_all#10.week_from_opening_7_5_2 1.open1_mean_cat_all#11.week_from_opening_7_5_2 1.open1_mean_cat_all#12.week_from_opening_7_5_2 1.open1_mean_cat_all#13.week_from_opening_7_5_2 1.open1_mean_cat_all#14.week_from_opening_7_5_2 1.open1_mean_cat_all#15.week_from_opening_7_5_2 1.open1_mean_cat_all#16.week_from_opening_7_5_2 1.open1_mean_cat_all#17.week_from_opening_7_5_2 1.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Hybrid) mlcolor(black))   (change_bl_trad_mmw_mw, keep(2.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Traditional) mlcolor(black)), yline(0, lcolor(black) lpattern(dash)) vertical rename(2.open1_mean_cat_all#1.week_from_opening_7_5_2 = 1.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 = 1.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 = 1.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 = 1.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 = 1.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 = 1.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 = 1.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 = 1.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 = 1.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 = 1.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 = 1.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 = 1.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 = 1.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 = 1.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 = 1.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 = 1.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 = 1.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2 = 1.open1_mean_cat_all#18.week_from_opening_7_5_2) coeflabels(1.open1_mean_cat_all#1.week_from_opening_7_5_2 = "-4" 1.open1_mean_cat_all#2.week_from_opening_7_5_2 = "-3" 1.open1_mean_cat_all#3.week_from_opening_7_5_2 = "-2" 1.open1_mean_cat_all#4.week_from_opening_7_5_2 = "-1" 1.open1_mean_cat_all#5.week_from_opening_7_5_2 = "0" 1.open1_mean_cat_all#6.week_from_opening_7_5_2 = "1" 1.open1_mean_cat_all#7.week_from_opening_7_5_2 = "2" 1.open1_mean_cat_all#8.week_from_opening_7_5_2 = "3" 1.open1_mean_cat_all#9.week_from_opening_7_5_2 = "4" 1.open1_mean_cat_all#10.week_from_opening_7_5_2 = "5" 1.open1_mean_cat_all#11.week_from_opening_7_5_2  = "6" 1.open1_mean_cat_all#12.week_from_opening_7_5_2 = "7" 1.open1_mean_cat_all#13.week_from_opening_7_5_2 = "8" 1.open1_mean_cat_all#14.week_from_opening_7_5_2 = "9" 1.open1_mean_cat_all#15.week_from_opening_7_5_2 = "10" 1.open1_mean_cat_all#16.week_from_opening_7_5_2 = "11" 1.open1_mean_cat_all#17.week_from_opening_7_5_2 = "12" 1.open1_mean_cat_all#18.week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)


graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Change from Baseline - Mask Mandate Wright - MW - 210406.gph", replace
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Change from Baseline - Mask Mandate Wright - MW - 210406.jpg", as(jpg) name("Graph") quality(100) replace



***WITHOUT MASK MANDATE 3&4
**MW
*running it once and saving the estimates as hybrid
reg cases_per_pop_bl_diff i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if mask_mandate_wright_opening_all == 0 & region == 2, vce(cluster fips)

estimates store change_bl_hybrid_nommw_mw

*running it again and saving the estimates as traditional
reg cases_per_pop_bl_diff i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if mask_mandate_wright_opening_all == 0 & region == 2, vce(cluster fips)

estimates store change_bl_trad_nommw_mw

**PLOTTING THE COEFFICIENTS*****
coefplot (change_bl_hybrid_nommw_mw, keep(1.open1_mean_cat_all#1.week_from_opening_7_5_2 1.open1_mean_cat_all#2.week_from_opening_7_5_2 1.open1_mean_cat_all#3.week_from_opening_7_5_2 1.open1_mean_cat_all#4.week_from_opening_7_5_2 1.open1_mean_cat_all#5.week_from_opening_7_5_2 1.open1_mean_cat_all#6.week_from_opening_7_5_2 1.open1_mean_cat_all#7.week_from_opening_7_5_2 1.open1_mean_cat_all#8.week_from_opening_7_5_2 1.open1_mean_cat_all#9.week_from_opening_7_5_2 1.open1_mean_cat_all#10.week_from_opening_7_5_2 1.open1_mean_cat_all#11.week_from_opening_7_5_2 1.open1_mean_cat_all#12.week_from_opening_7_5_2 1.open1_mean_cat_all#13.week_from_opening_7_5_2 1.open1_mean_cat_all#14.week_from_opening_7_5_2 1.open1_mean_cat_all#15.week_from_opening_7_5_2 1.open1_mean_cat_all#16.week_from_opening_7_5_2 1.open1_mean_cat_all#17.week_from_opening_7_5_2 1.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Hybrid) mlcolor(black))   (change_bl_trad_nommw_mw, keep(2.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Traditional) mlcolor(black)), yline(0, lcolor(black) lpattern(dash)) vertical rename(2.open1_mean_cat_all#1.week_from_opening_7_5_2 = 1.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 = 1.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 = 1.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 = 1.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 = 1.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 = 1.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 = 1.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 = 1.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 = 1.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 = 1.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 = 1.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 = 1.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 = 1.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 = 1.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 = 1.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 = 1.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 = 1.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2 = 1.open1_mean_cat_all#18.week_from_opening_7_5_2) coeflabels(1.open1_mean_cat_all#1.week_from_opening_7_5_2 = "-4" 1.open1_mean_cat_all#2.week_from_opening_7_5_2 = "-3" 1.open1_mean_cat_all#3.week_from_opening_7_5_2 = "-2" 1.open1_mean_cat_all#4.week_from_opening_7_5_2 = "-1" 1.open1_mean_cat_all#5.week_from_opening_7_5_2 = "0" 1.open1_mean_cat_all#6.week_from_opening_7_5_2 = "1" 1.open1_mean_cat_all#7.week_from_opening_7_5_2 = "2" 1.open1_mean_cat_all#8.week_from_opening_7_5_2 = "3" 1.open1_mean_cat_all#9.week_from_opening_7_5_2 = "4" 1.open1_mean_cat_all#10.week_from_opening_7_5_2 = "5" 1.open1_mean_cat_all#11.week_from_opening_7_5_2  = "6" 1.open1_mean_cat_all#12.week_from_opening_7_5_2 = "7" 1.open1_mean_cat_all#13.week_from_opening_7_5_2 = "8" 1.open1_mean_cat_all#14.week_from_opening_7_5_2 = "9" 1.open1_mean_cat_all#15.week_from_opening_7_5_2 = "10" 1.open1_mean_cat_all#16.week_from_opening_7_5_2 = "11" 1.open1_mean_cat_all#17.week_from_opening_7_5_2 = "12" 1.open1_mean_cat_all#18.week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)


graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Change from Baseline - No Mask Mandate Wright - MW - 210406.gph", replace
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Change from Baseline - No Mask Mandate Wright - MW - 210406.jpg", as(jpg) name("Graph") quality(100) replace








*WITH A MASK MANDATE
**S
*running it once and saving the estimates as hybrid
reg cases_per_pop_bl_diff i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if mask_mandate_wright_opening_all == 1 & region == 3, vce(cluster fips)

estimates store change_bl_hybrid_mmw_s

*running it again and saving the estimates as traditional
reg cases_per_pop_bl_diff i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if mask_mandate_wright_opening_all == 1 & region == 3, vce(cluster fips)

estimates store change_bl_trad_mmw_s

**PLOTTING THE COEFFICIENTS*****
coefplot (change_bl_hybrid_mmw_s, keep(1.open1_mean_cat_all#1.week_from_opening_7_5_2 1.open1_mean_cat_all#2.week_from_opening_7_5_2 1.open1_mean_cat_all#3.week_from_opening_7_5_2 1.open1_mean_cat_all#4.week_from_opening_7_5_2 1.open1_mean_cat_all#5.week_from_opening_7_5_2 1.open1_mean_cat_all#6.week_from_opening_7_5_2 1.open1_mean_cat_all#7.week_from_opening_7_5_2 1.open1_mean_cat_all#8.week_from_opening_7_5_2 1.open1_mean_cat_all#9.week_from_opening_7_5_2 1.open1_mean_cat_all#10.week_from_opening_7_5_2 1.open1_mean_cat_all#11.week_from_opening_7_5_2 1.open1_mean_cat_all#12.week_from_opening_7_5_2 1.open1_mean_cat_all#13.week_from_opening_7_5_2 1.open1_mean_cat_all#14.week_from_opening_7_5_2 1.open1_mean_cat_all#15.week_from_opening_7_5_2 1.open1_mean_cat_all#16.week_from_opening_7_5_2 1.open1_mean_cat_all#17.week_from_opening_7_5_2 1.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Hybrid) mlcolor(black))   (change_bl_trad_mmw_s, keep(2.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Traditional) mlcolor(black)), yline(0, lcolor(black) lpattern(dash)) vertical rename(2.open1_mean_cat_all#1.week_from_opening_7_5_2 = 1.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 = 1.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 = 1.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 = 1.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 = 1.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 = 1.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 = 1.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 = 1.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 = 1.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 = 1.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 = 1.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 = 1.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 = 1.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 = 1.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 = 1.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 = 1.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 = 1.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2 = 1.open1_mean_cat_all#18.week_from_opening_7_5_2) coeflabels(1.open1_mean_cat_all#1.week_from_opening_7_5_2 = "-4" 1.open1_mean_cat_all#2.week_from_opening_7_5_2 = "-3" 1.open1_mean_cat_all#3.week_from_opening_7_5_2 = "-2" 1.open1_mean_cat_all#4.week_from_opening_7_5_2 = "-1" 1.open1_mean_cat_all#5.week_from_opening_7_5_2 = "0" 1.open1_mean_cat_all#6.week_from_opening_7_5_2 = "1" 1.open1_mean_cat_all#7.week_from_opening_7_5_2 = "2" 1.open1_mean_cat_all#8.week_from_opening_7_5_2 = "3" 1.open1_mean_cat_all#9.week_from_opening_7_5_2 = "4" 1.open1_mean_cat_all#10.week_from_opening_7_5_2 = "5" 1.open1_mean_cat_all#11.week_from_opening_7_5_2  = "6" 1.open1_mean_cat_all#12.week_from_opening_7_5_2 = "7" 1.open1_mean_cat_all#13.week_from_opening_7_5_2 = "8" 1.open1_mean_cat_all#14.week_from_opening_7_5_2 = "9" 1.open1_mean_cat_all#15.week_from_opening_7_5_2 = "10" 1.open1_mean_cat_all#16.week_from_opening_7_5_2 = "11" 1.open1_mean_cat_all#17.week_from_opening_7_5_2 = "12" 1.open1_mean_cat_all#18.week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)


graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Change from Baseline - Mask Mandate Wright - S - 210406.gph", replace
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Change from Baseline - Mask Mandate Wright - S - 210406.jpg", as(jpg) name("Graph") quality(100) replace



***WITHOUT MASK MANDATE 3&4
**S
*running it once and saving the estimates as hybrid
reg cases_per_pop_bl_diff i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if mask_mandate_wright_opening_all == 0 & region == 3, vce(cluster fips)

estimates store change_bl_hybrid_nommw_s

*running it again and saving the estimates as traditional
reg cases_per_pop_bl_diff i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if mask_mandate_wright_opening_all == 0 & region == 3, vce(cluster fips)

estimates store change_bl_trad_nommw_s

**PLOTTING THE COEFFICIENTS*****
coefplot (change_bl_hybrid_nommw_s, keep(1.open1_mean_cat_all#1.week_from_opening_7_5_2 1.open1_mean_cat_all#2.week_from_opening_7_5_2 1.open1_mean_cat_all#3.week_from_opening_7_5_2 1.open1_mean_cat_all#4.week_from_opening_7_5_2 1.open1_mean_cat_all#5.week_from_opening_7_5_2 1.open1_mean_cat_all#6.week_from_opening_7_5_2 1.open1_mean_cat_all#7.week_from_opening_7_5_2 1.open1_mean_cat_all#8.week_from_opening_7_5_2 1.open1_mean_cat_all#9.week_from_opening_7_5_2 1.open1_mean_cat_all#10.week_from_opening_7_5_2 1.open1_mean_cat_all#11.week_from_opening_7_5_2 1.open1_mean_cat_all#12.week_from_opening_7_5_2 1.open1_mean_cat_all#13.week_from_opening_7_5_2 1.open1_mean_cat_all#14.week_from_opening_7_5_2 1.open1_mean_cat_all#15.week_from_opening_7_5_2 1.open1_mean_cat_all#16.week_from_opening_7_5_2 1.open1_mean_cat_all#17.week_from_opening_7_5_2 1.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Hybrid) mlcolor(black))   (change_bl_trad_nommw_s, keep(2.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Traditional) mlcolor(black)), yline(0, lcolor(black) lpattern(dash)) vertical rename(2.open1_mean_cat_all#1.week_from_opening_7_5_2 = 1.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 = 1.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 = 1.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 = 1.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 = 1.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 = 1.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 = 1.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 = 1.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 = 1.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 = 1.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 = 1.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 = 1.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 = 1.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 = 1.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 = 1.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 = 1.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 = 1.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2 = 1.open1_mean_cat_all#18.week_from_opening_7_5_2) coeflabels(1.open1_mean_cat_all#1.week_from_opening_7_5_2 = "-4" 1.open1_mean_cat_all#2.week_from_opening_7_5_2 = "-3" 1.open1_mean_cat_all#3.week_from_opening_7_5_2 = "-2" 1.open1_mean_cat_all#4.week_from_opening_7_5_2 = "-1" 1.open1_mean_cat_all#5.week_from_opening_7_5_2 = "0" 1.open1_mean_cat_all#6.week_from_opening_7_5_2 = "1" 1.open1_mean_cat_all#7.week_from_opening_7_5_2 = "2" 1.open1_mean_cat_all#8.week_from_opening_7_5_2 = "3" 1.open1_mean_cat_all#9.week_from_opening_7_5_2 = "4" 1.open1_mean_cat_all#10.week_from_opening_7_5_2 = "5" 1.open1_mean_cat_all#11.week_from_opening_7_5_2  = "6" 1.open1_mean_cat_all#12.week_from_opening_7_5_2 = "7" 1.open1_mean_cat_all#13.week_from_opening_7_5_2 = "8" 1.open1_mean_cat_all#14.week_from_opening_7_5_2 = "9" 1.open1_mean_cat_all#15.week_from_opening_7_5_2 = "10" 1.open1_mean_cat_all#16.week_from_opening_7_5_2 = "11" 1.open1_mean_cat_all#17.week_from_opening_7_5_2 = "12" 1.open1_mean_cat_all#18.week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)


graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Change from Baseline - No Mask Mandate Wright - S - 210406.gph", replace
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - Change from Baseline - No Mask Mandate Wright - S - 210406.jpg", as(jpg) name("Graph") quality(100) replace










*************************************
************THIS ONE WORKED**********
*************************************
*no previous cases
*running it once and saving the estimates as hybrid
reg cases_per_pop_bl_diff i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.c7_flag i.c8_internattravelcontrols_cat i.h2_testingpolicy_cat i.h3_contacttracing_cat i.h6_facialcoverings_cat i.fips, vce(cluster fips)

estimates store hybrid2

*then running it again and saving the estimates as traditional
reg cases_per_pop_bl_diff i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.c7_flag i.c8_internattravelcontrols_cat i.h2_testingpolicy_cat i.h3_contacttracing_cat i.h6_facialcoverings_cat i.fips, vce(cluster fips)

estimates store traditional2



**PLOTTING THE COEFFICIENTS*****
coefplot (hybrid2, keep(1.open1_mean_cat_all#1.week_from_opening_7_5_2 1.open1_mean_cat_all#2.week_from_opening_7_5_2 1.open1_mean_cat_all#3.week_from_opening_7_5_2 1.open1_mean_cat_all#4.week_from_opening_7_5_2 1.open1_mean_cat_all#5.week_from_opening_7_5_2 1.open1_mean_cat_all#6.week_from_opening_7_5_2 1.open1_mean_cat_all#7.week_from_opening_7_5_2 1.open1_mean_cat_all#8.week_from_opening_7_5_2 1.open1_mean_cat_all#9.week_from_opening_7_5_2 1.open1_mean_cat_all#10.week_from_opening_7_5_2 1.open1_mean_cat_all#11.week_from_opening_7_5_2 1.open1_mean_cat_all#12.week_from_opening_7_5_2 1.open1_mean_cat_all#13.week_from_opening_7_5_2 1.open1_mean_cat_all#14.week_from_opening_7_5_2 1.open1_mean_cat_all#15.week_from_opening_7_5_2 1.open1_mean_cat_all#16.week_from_opening_7_5_2 1.open1_mean_cat_all#17.week_from_opening_7_5_2 1.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Hybrid) mlcolor(black))   (traditional2, keep(2.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Traditional) mlcolor(black)), yline(0, lcolor(black) lpattern(dash)) vertical rename(2.open1_mean_cat_all#1.week_from_opening_7_5_2 = 1.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 = 1.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 = 1.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 = 1.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 = 1.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 = 1.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 = 1.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 = 1.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 = 1.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 = 1.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 = 1.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 = 1.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 = 1.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 = 1.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 = 1.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 = 1.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 = 1.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2 = 1.open1_mean_cat_all#18.week_from_opening_7_5_2) coeflabels(1.open1_mean_cat_all#1.week_from_opening_7_5_2 = "-4" 1.open1_mean_cat_all#2.week_from_opening_7_5_2 = "-3" 1.open1_mean_cat_all#3.week_from_opening_7_5_2 = "-2" 1.open1_mean_cat_all#4.week_from_opening_7_5_2 = "-1" 1.open1_mean_cat_all#5.week_from_opening_7_5_2 = "0" 1.open1_mean_cat_all#6.week_from_opening_7_5_2 = "1" 1.open1_mean_cat_all#7.week_from_opening_7_5_2 = "2" 1.open1_mean_cat_all#8.week_from_opening_7_5_2 = "3" 1.open1_mean_cat_all#9.week_from_opening_7_5_2 = "4" 1.open1_mean_cat_all#10.week_from_opening_7_5_2 = "5" 1.open1_mean_cat_all#11.week_from_opening_7_5_2  = "6" 1.open1_mean_cat_all#12.week_from_opening_7_5_2 = "7" 1.open1_mean_cat_all#13.week_from_opening_7_5_2 = "8" 1.open1_mean_cat_all#14.week_from_opening_7_5_2 = "9" 1.open1_mean_cat_all#15.week_from_opening_7_5_2 = "10" 1.open1_mean_cat_all#16.week_from_opening_7_5_2 = "11" 1.open1_mean_cat_all#17.week_from_opening_7_5_2 = "12" 1.open1_mean_cat_all#18.week_from_opening_7_5_2 = "13") graphregion(fcolor(white)) ciopts(recast(rcap)) xtitle("Week from school opening") ytitle("Regression coefficient") msymbol(d)


graph save "Graph" "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - 210329_0900.gph"
graph export "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\Coefplot - 210329_0900.jpg", as(jpg) name("Graph") quality(100)











*****CHANGING COEFFICIENT LABELS**************
coefplot (hybrid2, keep(1.open1_mean_cat_all#1.week_from_opening_7_5_2 1.open1_mean_cat_all#2.week_from_opening_7_5_2 1.open1_mean_cat_all#3.week_from_opening_7_5_2 1.open1_mean_cat_all#4.week_from_opening_7_5_2 1.open1_mean_cat_all#5.week_from_opening_7_5_2 1.open1_mean_cat_all#6.week_from_opening_7_5_2 1.open1_mean_cat_all#7.week_from_opening_7_5_2 1.open1_mean_cat_all#8.week_from_opening_7_5_2 1.open1_mean_cat_all#9.week_from_opening_7_5_2 1.open1_mean_cat_all#10.week_from_opening_7_5_2 1.open1_mean_cat_all#11.week_from_opening_7_5_2 1.open1_mean_cat_all#12.week_from_opening_7_5_2 1.open1_mean_cat_all#13.week_from_opening_7_5_2 1.open1_mean_cat_all#14.week_from_opening_7_5_2 1.open1_mean_cat_all#15.week_from_opening_7_5_2 1.open1_mean_cat_all#16.week_from_opening_7_5_2 1.open1_mean_cat_all#17.week_from_opening_7_5_2 1.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Hybrid))         (traditional2, keep(2.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Traditional)),              yline(0) vertical rename(2.open1_mean_cat_all#1.week_from_opening_7_5_2 = 1.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 = 1.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 = 1.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 = 1.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 = 1.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 = 1.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 = 1.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 = 1.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 = 1.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 = 1.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 = 1.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 = 1.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 = 1.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 = 1.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 = 1.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 = 1.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 = 1.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2 = 1.open1_mean_cat_all#18.week_from_opening_7_5_2)            coeflabels(1.open1_mean_cat_all#1.week_from_opening_7_5_2 = "-4" 1.open1_mean_cat_all#2.week_from_opening_7_5_2 = "-3" 1.open1_mean_cat_all#3.week_from_opening_7_5_2 = "-2" 1.open1_mean_cat_all#4.week_from_opening_7_5_2 = "-1" 1.open1_mean_cat_all#5.week_from_opening_7_5_2 = "0" 1.open1_mean_cat_all#6.week_from_opening_7_5_2 = "1" 1.open1_mean_cat_all#7.week_from_opening_7_5_2 = "2" 1.open1_mean_cat_all#8.week_from_opening_7_5_2 = "3" 1.open1_mean_cat_all#9.week_from_opening_7_5_2 = "4" 1.open1_mean_cat_all#10.week_from_opening_7_5_2 = "5" 1.open1_mean_cat_all#11.week_from_opening_7_5_2  = "6" 1.open1_mean_cat_all#12.week_from_opening_7_5_2 = "7" 1.open1_mean_cat_all#13.week_from_opening_7_5_2 = "8" 1.open1_mean_cat_all#14.week_from_opening_7_5_2 = "9" 1.open1_mean_cat_all#15.week_from_opening_7_5_2 = "10" 1.open1_mean_cat_all#16.week_from_opening_7_5_2 = "11" 1.open1_mean_cat_all#17.week_from_opening_7_5_2 = "12" 1.open1_mean_cat_all#18.week_from_opening_7_5_2 = "13")



 



*****THIS ONE WORKS**************
coefplot (hybrid2, keep(1.open1_mean_cat_all#1.week_from_opening_7_5_2 1.open1_mean_cat_all#2.week_from_opening_7_5_2 1.open1_mean_cat_all#3.week_from_opening_7_5_2 1.open1_mean_cat_all#4.week_from_opening_7_5_2 1.open1_mean_cat_all#5.week_from_opening_7_5_2 1.open1_mean_cat_all#6.week_from_opening_7_5_2 1.open1_mean_cat_all#7.week_from_opening_7_5_2 1.open1_mean_cat_all#8.week_from_opening_7_5_2 1.open1_mean_cat_all#9.week_from_opening_7_5_2 1.open1_mean_cat_all#10.week_from_opening_7_5_2 1.open1_mean_cat_all#11.week_from_opening_7_5_2 1.open1_mean_cat_all#12.week_from_opening_7_5_2 1.open1_mean_cat_all#13.week_from_opening_7_5_2 1.open1_mean_cat_all#14.week_from_opening_7_5_2 1.open1_mean_cat_all#15.week_from_opening_7_5_2 1.open1_mean_cat_all#16.week_from_opening_7_5_2 1.open1_mean_cat_all#17.week_from_opening_7_5_2 1.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Hybrid))   (traditional2, keep(2.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2) label(Traditional)), yline(0) vertical rename(2.open1_mean_cat_all#1.week_from_opening_7_5_2 = 1.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 = 1.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 = 1.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 = 1.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 = 1.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 = 1.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 = 1.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 = 1.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 = 1.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 = 1.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 = 1.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 = 1.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 = 1.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 = 1.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 = 1.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 = 1.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 = 1.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2 = 1.open1_mean_cat_all#18.week_from_opening_7_5_2)


*****************THIS ONE WORKS*****************
coefplot (hybrid, keep(1.open1_mean_cat_all#1.week_from_opening_7_5_2 1.open1_mean_cat_all#2.week_from_opening_7_5_2 1.open1_mean_cat_all#3.week_from_opening_7_5_2 1.open1_mean_cat_all#4.week_from_opening_7_5_2 ))    (traditional, keep(2.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 )), xline(0) vertical rename(2.open1_mean_cat_all#1.week_from_opening_7_5_2 = 1.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 = 1.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 = 1.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 = 1.open1_mean_cat_all#4.week_from_opening_7_5_2)

2.open1_mean_cat_all#5.week_from_opening_7_5_2 = 1.open1_mean_cat_all#5.week_from_opening_7_5_2
2.open1_mean_cat_all#6.week_from_opening_7_5_2 = 1.open1_mean_cat_all#6.week_from_opening_7_5_2
2.open1_mean_cat_all#7.week_from_opening_7_5_2 = 1.open1_mean_cat_all#7.week_from_opening_7_5_2
2.open1_mean_cat_all#8.week_from_opening_7_5_2 = 1.open1_mean_cat_all#8.week_from_opening_7_5_2
2.open1_mean_cat_all#9.week_from_opening_7_5_2 = 1.open1_mean_cat_all#9.week_from_opening_7_5_2
2.open1_mean_cat_all#10.week_from_opening_7_5_2 = 1.open1_mean_cat_all#10.week_from_opening_7_5_2
2.open1_mean_cat_all#11.week_from_opening_7_5_2 = 1.open1_mean_cat_all#11.week_from_opening_7_5_2
2.open1_mean_cat_all#12.week_from_opening_7_5_2 = 1.open1_mean_cat_all#12.week_from_opening_7_5_2
2.open1_mean_cat_all#13.week_from_opening_7_5_2 = 1.open1_mean_cat_all#13.week_from_opening_7_5_2
2.open1_mean_cat_all#14.week_from_opening_7_5_2 = 1.open1_mean_cat_all#14.week_from_opening_7_5_2
2.open1_mean_cat_all#15.week_from_opening_7_5_2 = 1.open1_mean_cat_all#15.week_from_opening_7_5_2
2.open1_mean_cat_all#16.week_from_opening_7_5_2 = 1.open1_mean_cat_all#16.week_from_opening_7_5_2
2.open1_mean_cat_all#17.week_from_opening_7_5_2 = 1.open1_mean_cat_all#17.week_from_opening_7_5_2
2.open1_mean_cat_all#18.week_from_opening_7_5_2 = 1.open1_mean_cat_all#18.week_from_opening_7_5_2




coefplot (hybrid, vertical keep(1.open1_mean_cat_all#1.week_from_opening_7_5_2 1.open1_mean_cat_all#2.week_from_opening_7_5_2 1.open1_mean_cat_all#3.week_from_opening_7_5_2 1.open1_mean_cat_all#4.week_from_opening_7_5_2 1.open1_mean_cat_all#5.week_from_opening_7_5_2 1.open1_mean_cat_all#6.week_from_opening_7_5_2 1.open1_mean_cat_all#7.week_from_opening_7_5_2 1.open1_mean_cat_all#8.week_from_opening_7_5_2 1.open1_mean_cat_all#9.week_from_opening_7_5_2 1.open1_mean_cat_all#10.week_from_opening_7_5_2 1.open1_mean_cat_all#11.week_from_opening_7_5_2 1.open1_mean_cat_all#12.week_from_opening_7_5_2 1.open1_mean_cat_all#13.week_from_opening_7_5_2 1.open1_mean_cat_all#14.week_from_opening_7_5_2 1.open1_mean_cat_all#15.week_from_opening_7_5_2 1.open1_mean_cat_all#16.week_from_opening_7_5_2 1.open1_mean_cat_all#17.week_from_opening_7_5_2 1.open1_mean_cat_all#18.week_from_opening_7_5_2)) (traditional, vertical keep(2.open1_mean_cat_all#1.week_from_opening_7_5_2 2.open1_mean_cat_all#2.week_from_opening_7_5_2 2.open1_mean_cat_all#3.week_from_opening_7_5_2 2.open1_mean_cat_all#4.week_from_opening_7_5_2 2.open1_mean_cat_all#5.week_from_opening_7_5_2 2.open1_mean_cat_all#6.week_from_opening_7_5_2 2.open1_mean_cat_all#7.week_from_opening_7_5_2 2.open1_mean_cat_all#8.week_from_opening_7_5_2 2.open1_mean_cat_all#9.week_from_opening_7_5_2 2.open1_mean_cat_all#10.week_from_opening_7_5_2 2.open1_mean_cat_all#11.week_from_opening_7_5_2 2.open1_mean_cat_all#12.week_from_opening_7_5_2 2.open1_mean_cat_all#13.week_from_opening_7_5_2 2.open1_mean_cat_all#14.week_from_opening_7_5_2 2.open1_mean_cat_all#15.week_from_opening_7_5_2 2.open1_mean_cat_all#16.week_from_opening_7_5_2 2.open1_mean_cat_all#17.week_from_opening_7_5_2 2.open1_mean_cat_all#18.week_from_opening_7_5_2)), rename(2.open1_mean_cat_all#1.week_from_opening_7_5_2 = 1.open1_mean_cat_all#1.week_from_opening_7_5_2 )






local coefinter1 1b.open1_mean_cat_all#1.week_from_opening_7_5_2 1b.open1_mean_cat_all#2.week_from_opening_7_5_2 1b.open1_mean_cat_all#3.week_from_opening_7_5_2 1b.open1_mean_cat_all#4.week_from_opening_7_5_2 1b.open1_mean_cat_all#5.week_from_opening_7_5_2 1b.open1_mean_cat_all#6.week_from_opening_7_5_2 1b.open1_mean_cat_all#7.week_from_opening_7_5_2 1b.open1_mean_cat_all#8.week_from_opening_7_5_2 1b.open1_mean_cat_all#9.week_from_opening_7_5_2 1b.open1_mean_cat_all#10.week_from_opening_7_5_2 1b.open1_mean_cat_all#11.week_from_opening_7_5_2 1b.open1_mean_cat_all#12.week_from_opening_7_5_2 1b.open1_mean_cat_all#13.week_from_opening_7_5_2 1b.open1_mean_cat_all#14.week_from_opening_7_5_2 1b.open1_mean_cat_all#15.week_from_opening_7_5_2 1b.open1_mean_cat_all#16.week_from_opening_7_5_2 1b.open1_mean_cat_all#17.week_from_opening_7_5_2 1b.open1_mean_cat_all#18.week_from_opening_7_5_2

global coefinter2 2b.open1_mean_cat_all#1.week_from_opening_7_5_2 2b.open1_mean_cat_all#2.week_from_opening_7_5_2 2b.open1_mean_cat_all#3.week_from_opening_7_5_2 2b.open1_mean_cat_all#4.week_from_opening_7_5_2 2b.open1_mean_cat_all#5.week_from_opening_7_5_2 2b.open1_mean_cat_all#6.week_from_opening_7_5_2 2b.open1_mean_cat_all#7.week_from_opening_7_5_2 2b.open1_mean_cat_all#8.week_from_opening_7_5_2 2b.open1_mean_cat_all#9.week_from_opening_7_5_2 2b.open1_mean_cat_all#10.week_from_opening_7_5_2 2b.open1_mean_cat_all#11.week_from_opening_7_5_2 2b.open1_mean_cat_all#12.week_from_opening_7_5_2 2b.open1_mean_cat_all#13.week_from_opening_7_5_2 2b.open1_mean_cat_all#14.week_from_opening_7_5_2 2b.open1_mean_cat_all#15.week_from_opening_7_5_2 2b.open1_mean_cat_all#16.week_from_opening_7_5_2 2b.open1_mean_cat_all#17.week_from_opening_7_5_2 2b.open1_mean_cat_all#18.week_from_opening_7_5_2

**NE only
*previous cases
reg cases_per_pop_log i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 cases_per_pop_prior_week_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ c2_workplaceclosing_10 c2_workplaceclosing_20 c2_workplaceclosing_30  c3_cancelpublicevents_10 c3_cancelpublicevents_20   c4_restrictionsongatherings_10 c4_restrictionsongatherings_20 c4_restrictionsongatherings_30 c4_restrictionsongatherings_40 c5_closepublictransport_10 c5_closepublictransport_20  c6_stayathomerequirements_10 c6_stayathomerequirements_20  c7_restrictionsoninternalmovemen c8_internationaltravelcontrols_1 c8_internationaltravelcontrols_2 c8_internationaltravelcontrols_3 h1_publicinformationcampaigns_10 h1_publicinformationcampaigns_20 h2_testingpolicy_10 h2_testingpolicy_20 h2_testingpolicy_30 h3_contacttracing_10 h3_contacttracing_20 h6_facialcoverings_10 h6_facialcoverings_20 h6_facialcoverings_30 h6_facialcoverings_40 i.fips if region == 0, vce(cluster fips)

*no previous cases
reg cases_per_pop_log i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ c2_workplaceclosing_10 c2_workplaceclosing_20 c2_workplaceclosing_30  c3_cancelpublicevents_10 c3_cancelpublicevents_20   c4_restrictionsongatherings_10 c4_restrictionsongatherings_20 c4_restrictionsongatherings_30 c4_restrictionsongatherings_40 c5_closepublictransport_10 c5_closepublictransport_20  c6_stayathomerequirements_10 c6_stayathomerequirements_20  c7_restrictionsoninternalmovemen c8_internationaltravelcontrols_1 c8_internationaltravelcontrols_2 c8_internationaltravelcontrols_3 h1_publicinformationcampaigns_10 h1_publicinformationcampaigns_20 h2_testingpolicy_10 h2_testingpolicy_20 h2_testingpolicy_30 h3_contacttracing_10 h3_contacttracing_20 h6_facialcoverings_10 h6_facialcoverings_20 h6_facialcoverings_30 h6_facialcoverings_40 i.fips if region == 0, vce(cluster fips)

**W only
*previous cases
reg cases_per_pop_log i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 cases_per_pop_prior_week_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ c2_workplaceclosing_10 c2_workplaceclosing_20 c2_workplaceclosing_30  c3_cancelpublicevents_10 c3_cancelpublicevents_20   c4_restrictionsongatherings_10 c4_restrictionsongatherings_20 c4_restrictionsongatherings_30 c4_restrictionsongatherings_40 c5_closepublictransport_10 c5_closepublictransport_20  c6_stayathomerequirements_10 c6_stayathomerequirements_20  c7_restrictionsoninternalmovemen c8_internationaltravelcontrols_1 c8_internationaltravelcontrols_2 c8_internationaltravelcontrols_3 h1_publicinformationcampaigns_10 h1_publicinformationcampaigns_20 h2_testingpolicy_10 h2_testingpolicy_20 h2_testingpolicy_30 h3_contacttracing_10 h3_contacttracing_20 h6_facialcoverings_10 h6_facialcoverings_20 h6_facialcoverings_30 h6_facialcoverings_40 i.fips if region == 1, vce(cluster fips)

*no previous cases
reg cases_per_pop_log i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ c2_workplaceclosing_10 c2_workplaceclosing_20 c2_workplaceclosing_30  c3_cancelpublicevents_10 c3_cancelpublicevents_20   c4_restrictionsongatherings_10 c4_restrictionsongatherings_20 c4_restrictionsongatherings_30 c4_restrictionsongatherings_40 c5_closepublictransport_10 c5_closepublictransport_20  c6_stayathomerequirements_10 c6_stayathomerequirements_20  c7_restrictionsoninternalmovemen c8_internationaltravelcontrols_1 c8_internationaltravelcontrols_2 c8_internationaltravelcontrols_3 h1_publicinformationcampaigns_10 h1_publicinformationcampaigns_20 h2_testingpolicy_10 h2_testingpolicy_20 h2_testingpolicy_30 h3_contacttracing_10 h3_contacttracing_20 h6_facialcoverings_10 h6_facialcoverings_20 h6_facialcoverings_30 h6_facialcoverings_40 i.fips if region == 1, vce(cluster fips)

**MW only
*previous cases
reg cases_per_pop_log i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 cases_per_pop_prior_week_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ c2_workplaceclosing_10 c2_workplaceclosing_20 c2_workplaceclosing_30  c3_cancelpublicevents_10 c3_cancelpublicevents_20   c4_restrictionsongatherings_10 c4_restrictionsongatherings_20 c4_restrictionsongatherings_30 c4_restrictionsongatherings_40 c5_closepublictransport_10 c5_closepublictransport_20  c6_stayathomerequirements_10 c6_stayathomerequirements_20  c7_restrictionsoninternalmovemen c8_internationaltravelcontrols_1 c8_internationaltravelcontrols_2 c8_internationaltravelcontrols_3 h1_publicinformationcampaigns_10 h1_publicinformationcampaigns_20 h2_testingpolicy_10 h2_testingpolicy_20 h2_testingpolicy_30 h3_contacttracing_10 h3_contacttracing_20 h6_facialcoverings_10 h6_facialcoverings_20 h6_facialcoverings_30 h6_facialcoverings_40 i.fips if region == 2, vce(cluster fips)

*no previous cases
reg cases_per_pop_log i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ c2_workplaceclosing_10 c2_workplaceclosing_20 c2_workplaceclosing_30  c3_cancelpublicevents_10 c3_cancelpublicevents_20   c4_restrictionsongatherings_10 c4_restrictionsongatherings_20 c4_restrictionsongatherings_30 c4_restrictionsongatherings_40 c5_closepublictransport_10 c5_closepublictransport_20  c6_stayathomerequirements_10 c6_stayathomerequirements_20  c7_restrictionsoninternalmovemen c8_internationaltravelcontrols_1 c8_internationaltravelcontrols_2 c8_internationaltravelcontrols_3 h1_publicinformationcampaigns_10 h1_publicinformationcampaigns_20 h2_testingpolicy_10 h2_testingpolicy_20 h2_testingpolicy_30 h3_contacttracing_10 h3_contacttracing_20 h6_facialcoverings_10 h6_facialcoverings_20 h6_facialcoverings_30 h6_facialcoverings_40 i.fips if region == 2, vce(cluster fips)

**S only
*previous cases
reg cases_per_pop_log i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 cases_per_pop_prior_week_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ c2_workplaceclosing_10 c2_workplaceclosing_20 c2_workplaceclosing_30  c3_cancelpublicevents_10 c3_cancelpublicevents_20   c4_restrictionsongatherings_10 c4_restrictionsongatherings_20 c4_restrictionsongatherings_30 c4_restrictionsongatherings_40 c5_closepublictransport_10 c5_closepublictransport_20  c6_stayathomerequirements_10 c6_stayathomerequirements_20  c7_restrictionsoninternalmovemen c8_internationaltravelcontrols_1 c8_internationaltravelcontrols_2 c8_internationaltravelcontrols_3 h1_publicinformationcampaigns_10 h1_publicinformationcampaigns_20 h2_testingpolicy_10 h2_testingpolicy_20 h2_testingpolicy_30 h3_contacttracing_10 h3_contacttracing_20 h6_facialcoverings_10 h6_facialcoverings_20 h6_facialcoverings_30 h6_facialcoverings_40 i.fips if region == 3, vce(cluster fips)

*no previous cases
reg cases_per_pop_log i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ c2_workplaceclosing_10 c2_workplaceclosing_20 c2_workplaceclosing_30  c3_cancelpublicevents_10 c3_cancelpublicevents_20   c4_restrictionsongatherings_10 c4_restrictionsongatherings_20 c4_restrictionsongatherings_30 c4_restrictionsongatherings_40 c5_closepublictransport_10 c5_closepublictransport_20  c6_stayathomerequirements_10 c6_stayathomerequirements_20  c7_restrictionsoninternalmovemen c8_internationaltravelcontrols_1 c8_internationaltravelcontrols_2 c8_internationaltravelcontrols_3 h1_publicinformationcampaigns_10 h1_publicinformationcampaigns_20 h2_testingpolicy_10 h2_testingpolicy_20 h2_testingpolicy_30 h3_contacttracing_10 h3_contacttracing_20 h6_facialcoverings_10 h6_facialcoverings_20 h6_facialcoverings_30 h6_facialcoverings_40 i.fips if region == 3, vce(cluster fips)






log using "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\COVID School Analyses - post-opening dummy - 210329.smcl", replace

***post-opening dummy
**overall
reg cases_per_pop_log i.open1_mean_cat_all i.post_opening open1_mean_cat_all#post_opening retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips , vce(cluster fips)

**NE only
reg cases_per_pop_log i.open1_mean_cat_all i.post_opening open1_mean_cat_all#post_opening retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if region == 0, vce(cluster fips)

**W only
reg cases_per_pop_log i.open1_mean_cat_all i.post_opening open1_mean_cat_all#post_opening retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if region == 1, vce(cluster fips)

**MW only
reg cases_per_pop_log i.open1_mean_cat_all i.post_opening open1_mean_cat_all#post_opening retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if region == 2, vce(cluster fips)

**S only
reg cases_per_pop_log i.open1_mean_cat_all i.post_opening open1_mean_cat_all#post_opening retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips  if region == 3, vce(cluster fips)



log using "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\COVID School Analyses - post-opening dummy change from baseline - 210329.smcl", replace

***post-opening dummy change from baseline
**overall
reg cases_per_pop_bl_diff i.open1_mean_cat_all i.post_opening open1_mean_cat_all#post_opening retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips , vce(cluster fips)

**NE only
reg cases_per_pop_bl_diff i.open1_mean_cat_all i.post_opening open1_mean_cat_all#post_opening retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if region == 0, vce(cluster fips)

**W only
reg cases_per_pop_bl_diff i.open1_mean_cat_all i.post_opening open1_mean_cat_all#post_opening retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if region == 1, vce(cluster fips)

**MW only
reg cases_per_pop_bl_diff i.open1_mean_cat_all i.post_opening open1_mean_cat_all#post_opening retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips if region == 2, vce(cluster fips)

**S only
reg cases_per_pop_bl_diff i.open1_mean_cat_all i.post_opening open1_mean_cat_all#post_opening retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ i.c2_workplaceclosing_cat i.c3_cancelpublicevents_cat i.c4_restrictionsongatherings_cat i.c5_closepublictransport_cat i.h2_testingpolicy_cat  i.h3_contacttracing_cat i.h6_facialcoverings_cat  i.state_fips i.state_fips#week_from_opening_7_5_2 i.fips  if region == 3, vce(cluster fips)




***CHANGE FROM BASELINE
log using "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\COVID School Analyses - chnage from baseline - 210323.smcl", replace


***UNADJUSTED MEANS
**across all regions
*across all school types
mean deaths_per_pop_bl_diff, over(week_from_opening_7_5_2)
mean cases_per_pop_bl_diff, over(week_from_opening_7_5_2)

*by different school types
mean cases_per_pop_bl_diff if open1_mean_cat_all == 0, over(week_from_opening_7_5_2)
mean cases_per_pop_bl_diff if open1_mean_cat_all == 1, over(week_from_opening_7_5_2)
mean cases_per_pop_bl_diff if open1_mean_cat_all == 2, over(week_from_opening_7_5_2)

mean deaths_per_pop_bl_diff if open1_mean_cat_all == 0, over(week_from_opening_7_5_2)
mean deaths_per_pop_bl_diff if open1_mean_cat_all == 1, over(week_from_opening_7_5_2)
mean deaths_per_pop_bl_diff if open1_mean_cat_all == 2, over(week_from_opening_7_5_2)

**NE region
*across all school types
mean deaths_per_pop_bl_diff if region == 0, over(week_from_opening_7_5_2)
mean cases_per_pop_bl_diff if region == 0, over(week_from_opening_7_5_2)

*by different school types
mean cases_per_pop_bl_diff if open1_mean_cat_all == 0 & region == 0, over(week_from_opening_7_5_2)
mean cases_per_pop_bl_diff if open1_mean_cat_all == 1 & region == 0, over(week_from_opening_7_5_2)
mean cases_per_pop_bl_diff if open1_mean_cat_all == 2 & region == 0, over(week_from_opening_7_5_2)

mean deaths_per_pop_bl_diff if open1_mean_cat_all == 0 & region == 0, over(week_from_opening_7_5_2)
mean deaths_per_pop_bl_diff if open1_mean_cat_all == 1 & region == 0, over(week_from_opening_7_5_2)
mean deaths_per_pop_bl_diff if open1_mean_cat_all == 2 & region == 0, over(week_from_opening_7_5_2)

**W region
*across all school types
mean deaths_per_pop_bl_diff if region == 1, over(week_from_opening_7_5_2)
mean cases_per_pop_bl_diff if region == 1, over(week_from_opening_7_5_2)

*by different school types
mean cases_per_pop_bl_diff if open1_mean_cat_all == 0 & region == 1, over(week_from_opening_7_5_2)
mean cases_per_pop_bl_diff if open1_mean_cat_all == 1 & region == 1, over(week_from_opening_7_5_2)
mean cases_per_pop_bl_diff if open1_mean_cat_all == 2 & region == 1, over(week_from_opening_7_5_2)

mean deaths_per_pop_bl_diff if open1_mean_cat_all == 0 & region == 1, over(week_from_opening_7_5_2)
mean deaths_per_pop_bl_diff if open1_mean_cat_all == 1 & region == 1, over(week_from_opening_7_5_2)
mean deaths_per_pop_bl_diff if open1_mean_cat_all == 2 & region == 1, over(week_from_opening_7_5_2)


**MW region
*across all school types
mean deaths_per_pop_bl_diff if region == 2, over(week_from_opening_7_5_2)
mean cases_per_pop_bl_diff if region == 2, over(week_from_opening_7_5_2)

*by different school types
mean cases_per_pop_bl_diff if open1_mean_cat_all == 0 & region == 2, over(week_from_opening_7_5_2)
mean cases_per_pop_bl_diff if open1_mean_cat_all == 1 & region == 2, over(week_from_opening_7_5_2)
mean cases_per_pop_bl_diff if open1_mean_cat_all == 2 & region == 2, over(week_from_opening_7_5_2)

mean deaths_per_pop_bl_diff if open1_mean_cat_all == 0 & region == 2, over(week_from_opening_7_5_2)
mean deaths_per_pop_bl_diff if open1_mean_cat_all == 1 & region == 2, over(week_from_opening_7_5_2)
mean deaths_per_pop_bl_diff if open1_mean_cat_all == 2 & region == 2, over(week_from_opening_7_5_2)


**S region
*across all school types
mean deaths_per_pop_bl_diff if region == 3, over(week_from_opening_7_5_2)
mean cases_per_pop_bl_diff if region == 3, over(week_from_opening_7_5_2)

*by different school types
mean cases_per_pop_bl_diff if open1_mean_cat_all == 0 & region == 3, over(week_from_opening_7_5_2)
mean cases_per_pop_bl_diff if open1_mean_cat_all == 1 & region == 3, over(week_from_opening_7_5_2)
mean cases_per_pop_bl_diff if open1_mean_cat_all == 2 & region == 3, over(week_from_opening_7_5_2)

mean deaths_per_pop_bl_diff if open1_mean_cat_all == 0 & region == 3, over(week_from_opening_7_5_2)
mean deaths_per_pop_bl_diff if open1_mean_cat_all == 1 & region == 3, over(week_from_opening_7_5_2)
mean deaths_per_pop_bl_diff if open1_mean_cat_all == 2 & region == 3, over(week_from_opening_7_5_2)





**overall
*previous cases
reg cases_per_pop_bl_diff i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 cases_per_pop_prior_week_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ c2_workplaceclosing_10 c2_workplaceclosing_20 c2_workplaceclosing_30  c3_cancelpublicevents_10 c3_cancelpublicevents_20   c4_restrictionsongatherings_10 c4_restrictionsongatherings_20 c4_restrictionsongatherings_30 c4_restrictionsongatherings_40 c5_closepublictransport_10 c5_closepublictransport_20  c6_stayathomerequirements_10 c6_stayathomerequirements_20  c7_restrictionsoninternalmovemen c8_internationaltravelcontrols_1 c8_internationaltravelcontrols_2 c8_internationaltravelcontrols_3 h1_publicinformationcampaigns_10 h1_publicinformationcampaigns_20 h2_testingpolicy_10 h2_testingpolicy_20 h2_testingpolicy_30 h3_contacttracing_10 h3_contacttracing_20 h6_facialcoverings_10 h6_facialcoverings_20 h6_facialcoverings_30 h6_facialcoverings_40 i.fips, vce(cluster fips)

*no previous cases
reg cases_per_pop_bl_diff i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ c2_workplaceclosing_10 c2_workplaceclosing_20 c2_workplaceclosing_30  c3_cancelpublicevents_10 c3_cancelpublicevents_20   c4_restrictionsongatherings_10 c4_restrictionsongatherings_20 c4_restrictionsongatherings_30 c4_restrictionsongatherings_40 c5_closepublictransport_10 c5_closepublictransport_20  c6_stayathomerequirements_10 c6_stayathomerequirements_20  c7_restrictionsoninternalmovemen c8_internationaltravelcontrols_1 c8_internationaltravelcontrols_2 c8_internationaltravelcontrols_3 h1_publicinformationcampaigns_10 h1_publicinformationcampaigns_20 h2_testingpolicy_10 h2_testingpolicy_20 h2_testingpolicy_30 h3_contacttracing_10 h3_contacttracing_20 h6_facialcoverings_10 h6_facialcoverings_20 h6_facialcoverings_30 h6_facialcoverings_40 i.fips, vce(cluster fips)

**NE only
*previous cases
reg cases_per_pop_bl_diff i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 cases_per_pop_prior_week_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ c2_workplaceclosing_10 c2_workplaceclosing_20 c2_workplaceclosing_30  c3_cancelpublicevents_10 c3_cancelpublicevents_20   c4_restrictionsongatherings_10 c4_restrictionsongatherings_20 c4_restrictionsongatherings_30 c4_restrictionsongatherings_40 c5_closepublictransport_10 c5_closepublictransport_20  c6_stayathomerequirements_10 c6_stayathomerequirements_20  c7_restrictionsoninternalmovemen c8_internationaltravelcontrols_1 c8_internationaltravelcontrols_2 c8_internationaltravelcontrols_3 h1_publicinformationcampaigns_10 h1_publicinformationcampaigns_20 h2_testingpolicy_10 h2_testingpolicy_20 h2_testingpolicy_30 h3_contacttracing_10 h3_contacttracing_20 h6_facialcoverings_10 h6_facialcoverings_20 h6_facialcoverings_30 h6_facialcoverings_40 i.fips if region == 0, vce(cluster fips)

*no previous cases
reg cases_per_pop_bl_diff i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ c2_workplaceclosing_10 c2_workplaceclosing_20 c2_workplaceclosing_30  c3_cancelpublicevents_10 c3_cancelpublicevents_20   c4_restrictionsongatherings_10 c4_restrictionsongatherings_20 c4_restrictionsongatherings_30 c4_restrictionsongatherings_40 c5_closepublictransport_10 c5_closepublictransport_20  c6_stayathomerequirements_10 c6_stayathomerequirements_20  c7_restrictionsoninternalmovemen c8_internationaltravelcontrols_1 c8_internationaltravelcontrols_2 c8_internationaltravelcontrols_3 h1_publicinformationcampaigns_10 h1_publicinformationcampaigns_20 h2_testingpolicy_10 h2_testingpolicy_20 h2_testingpolicy_30 h3_contacttracing_10 h3_contacttracing_20 h6_facialcoverings_10 h6_facialcoverings_20 h6_facialcoverings_30 h6_facialcoverings_40 i.fips if region == 0, vce(cluster fips)

**W only
*previous cases
reg cases_per_pop_bl_diff i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 cases_per_pop_prior_week_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ c2_workplaceclosing_10 c2_workplaceclosing_20 c2_workplaceclosing_30  c3_cancelpublicevents_10 c3_cancelpublicevents_20   c4_restrictionsongatherings_10 c4_restrictionsongatherings_20 c4_restrictionsongatherings_30 c4_restrictionsongatherings_40 c5_closepublictransport_10 c5_closepublictransport_20  c6_stayathomerequirements_10 c6_stayathomerequirements_20  c7_restrictionsoninternalmovemen c8_internationaltravelcontrols_1 c8_internationaltravelcontrols_2 c8_internationaltravelcontrols_3 h1_publicinformationcampaigns_10 h1_publicinformationcampaigns_20 h2_testingpolicy_10 h2_testingpolicy_20 h2_testingpolicy_30 h3_contacttracing_10 h3_contacttracing_20 h6_facialcoverings_10 h6_facialcoverings_20 h6_facialcoverings_30 h6_facialcoverings_40 i.fips if region == 1, vce(cluster fips)

*no previous cases
reg cases_per_pop_bl_diff i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ c2_workplaceclosing_10 c2_workplaceclosing_20 c2_workplaceclosing_30  c3_cancelpublicevents_10 c3_cancelpublicevents_20   c4_restrictionsongatherings_10 c4_restrictionsongatherings_20 c4_restrictionsongatherings_30 c4_restrictionsongatherings_40 c5_closepublictransport_10 c5_closepublictransport_20  c6_stayathomerequirements_10 c6_stayathomerequirements_20  c7_restrictionsoninternalmovemen c8_internationaltravelcontrols_1 c8_internationaltravelcontrols_2 c8_internationaltravelcontrols_3 h1_publicinformationcampaigns_10 h1_publicinformationcampaigns_20 h2_testingpolicy_10 h2_testingpolicy_20 h2_testingpolicy_30 h3_contacttracing_10 h3_contacttracing_20 h6_facialcoverings_10 h6_facialcoverings_20 h6_facialcoverings_30 h6_facialcoverings_40 i.fips if region == 1, vce(cluster fips)

**MW only
*previous cases
reg cases_per_pop_bl_diff i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 cases_per_pop_prior_week_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ c2_workplaceclosing_10 c2_workplaceclosing_20 c2_workplaceclosing_30  c3_cancelpublicevents_10 c3_cancelpublicevents_20   c4_restrictionsongatherings_10 c4_restrictionsongatherings_20 c4_restrictionsongatherings_30 c4_restrictionsongatherings_40 c5_closepublictransport_10 c5_closepublictransport_20  c6_stayathomerequirements_10 c6_stayathomerequirements_20  c7_restrictionsoninternalmovemen c8_internationaltravelcontrols_1 c8_internationaltravelcontrols_2 c8_internationaltravelcontrols_3 h1_publicinformationcampaigns_10 h1_publicinformationcampaigns_20 h2_testingpolicy_10 h2_testingpolicy_20 h2_testingpolicy_30 h3_contacttracing_10 h3_contacttracing_20 h6_facialcoverings_10 h6_facialcoverings_20 h6_facialcoverings_30 h6_facialcoverings_40 i.fips if region == 2, vce(cluster fips)

*no previous cases
reg cases_per_pop_bl_diff i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ c2_workplaceclosing_10 c2_workplaceclosing_20 c2_workplaceclosing_30  c3_cancelpublicevents_10 c3_cancelpublicevents_20   c4_restrictionsongatherings_10 c4_restrictionsongatherings_20 c4_restrictionsongatherings_30 c4_restrictionsongatherings_40 c5_closepublictransport_10 c5_closepublictransport_20  c6_stayathomerequirements_10 c6_stayathomerequirements_20  c7_restrictionsoninternalmovemen c8_internationaltravelcontrols_1 c8_internationaltravelcontrols_2 c8_internationaltravelcontrols_3 h1_publicinformationcampaigns_10 h1_publicinformationcampaigns_20 h2_testingpolicy_10 h2_testingpolicy_20 h2_testingpolicy_30 h3_contacttracing_10 h3_contacttracing_20 h6_facialcoverings_10 h6_facialcoverings_20 h6_facialcoverings_30 h6_facialcoverings_40 i.fips if region == 2, vce(cluster fips)

**S only
*previous cases
reg cases_per_pop_bl_diff i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 cases_per_pop_prior_week_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ c2_workplaceclosing_10 c2_workplaceclosing_20 c2_workplaceclosing_30  c3_cancelpublicevents_10 c3_cancelpublicevents_20   c4_restrictionsongatherings_10 c4_restrictionsongatherings_20 c4_restrictionsongatherings_30 c4_restrictionsongatherings_40 c5_closepublictransport_10 c5_closepublictransport_20  c6_stayathomerequirements_10 c6_stayathomerequirements_20  c7_restrictionsoninternalmovemen c8_internationaltravelcontrols_1 c8_internationaltravelcontrols_2 c8_internationaltravelcontrols_3 h1_publicinformationcampaigns_10 h1_publicinformationcampaigns_20 h2_testingpolicy_10 h2_testingpolicy_20 h2_testingpolicy_30 h3_contacttracing_10 h3_contacttracing_20 h6_facialcoverings_10 h6_facialcoverings_20 h6_facialcoverings_30 h6_facialcoverings_40 i.fips if region == 3, vce(cluster fips)

*no previous cases
reg cases_per_pop_bl_diff i.open1_mean_cat_all i.week_from_opening_7_5_2 open1_mean_cat_all#week_from_opening_7_5_2 retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ c2_workplaceclosing_10 c2_workplaceclosing_20 c2_workplaceclosing_30  c3_cancelpublicevents_10 c3_cancelpublicevents_20   c4_restrictionsongatherings_10 c4_restrictionsongatherings_20 c4_restrictionsongatherings_30 c4_restrictionsongatherings_40 c5_closepublictransport_10 c5_closepublictransport_20  c6_stayathomerequirements_10 c6_stayathomerequirements_20  c7_restrictionsoninternalmovemen c8_internationaltravelcontrols_1 c8_internationaltravelcontrols_2 c8_internationaltravelcontrols_3 h1_publicinformationcampaigns_10 h1_publicinformationcampaigns_20 h2_testingpolicy_10 h2_testingpolicy_20 h2_testingpolicy_30 h3_contacttracing_10 h3_contacttracing_20 h6_facialcoverings_10 h6_facialcoverings_20 h6_facialcoverings_30 h6_facialcoverings_40 i.fips if region == 3, vce(cluster fips)








*******************SAVING THE DATASET********************
save "C:\Users\u0154844\Box Sync\Things from Desktop - 150918\Current Projects\COVID-19\School Simulation\COVID School - 210324.dta"



******************CREATING DATSET TO SHARE WITH EMILY*****************
keep cases_per_pop cases_per_pop_log cases_per_pop_bl_diff deaths_per_pop deaths_per_pop_log deaths_per_pop_bl_diff r_0

open1_mean_cat_all week_from_opening_7_5_2 

retail_and_recreation_percent_ch grocery_and_pharmacy_percent_cha  workplaces_percent_change_from_b residential_percent_change_from_ parks_percent_change_from_baseli transit_stations_percent_change_

c2_workplaceclosing_10 c2_workplaceclosing_20 c2_workplaceclosing_30  c3_cancelpublicevents_10 c3_cancelpublicevents_20   c4_restrictionsongatherings_10 c4_restrictionsongatherings_20 c4_restrictionsongatherings_30 c4_restrictionsongatherings_40 c5_closepublictransport_10 c5_closepublictransport_20  c6_stayathomerequirements_10 c6_stayathomerequirements_20  c7_restrictionsoninternalmovemen c8_internationaltravelcontrols_1 c8_internationaltravelcontrols_2 c8_internationaltravelcontrols_3 h1_publicinformationcampaigns_10 h1_publicinformationcampaigns_20 h2_testingpolicy_10 h2_testingpolicy_20 h2_testingpolicy_30 h3_contacttracing_10 h3_contacttracing_20 h6_facialcoverings_10 h6_facialcoverings_20 h6_facialcoverings_30 h6_facialcoverings_40

region fips 






